Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VCS dependency installation fails with 'Could not get current working directory' #3432

Closed
theodox opened this issue Jan 9, 2019 · 6 comments · Fixed by #3298
Closed

VCS dependency installation fails with 'Could not get current working directory' #3432

theodox opened this issue Jan 9, 2019 · 6 comments · Fixed by #3298
Labels
Category: VCS Relates to version control system dependencies. Type: Bug 🐛 This issue is a bug. Type: Vendored Dependencies This issue affects vendored dependencies within pipenv.

Comments

@theodox
Copy link

theodox commented Jan 9, 2019

Issue description

Attempting to install a vcs dependencies fails with .fatal: Could not get current working directory: No such file or directory . In order to get a clean repro case I simply made a new directory, cd'd into it, and used the vcs example from the docs,

 pipenv install -e git+https://github.com/requests/[email protected]#egg=requests

Expected result

I expected the installation to succeed

Actual result

Here's the traceback.
In previous trial runs I believe I observed an off-by-one problem in the tracebacks: the run prior to this referred to a different repo -- not requests -- that I had tried to install earlier and which had failed the same way. This traceback is the second attempt to use the requests example in a row so if the same incorrect traceback was generated it's not obvious because I used the same URL twice in a row.

steve@DRIFT MINGW64 ~/prj
$ mkdir dev2

steve@DRIFT MINGW64 ~/prj
$ cd dev2

steve@DRIFT MINGW64 ~/prj/dev2
$ pipenv install -e git+https://github.com/requests/[email protected]#egg=requests
Creating a virtualenv for this project…
Pipfile: C:\Users\steve\prj\dev2\Pipfile
Using d:\pythons\371\python.exe (3.7.1) to create virtualenv…
[=   ] Creating virtual environment...Already using interpreter d:\pythons\371\python.exe
Using base prefix 'd:\\pythons\\371'
New python executable in C:\Users\steve\.virtualenvs\dev2-MdgJu4jJ\Scripts\python.exe
Installing setuptools, pip, wheel...
done.

Successfully created virtual environment!
Virtualenv location: C:\Users\steve\.virtualenvs\dev2-MdgJu4jJ
Creating a Pipfile for this project…
Installing -e git+https://github.com/requests/[email protected]#egg=requests…
Adding requests to Pipfile's [packages]…
Installation Succeeded
Pipfile.lock not found, creating…
Locking [dev-packages] dependencies…
Locking [packages] dependencies…
[    ] Pinning VCS Packages...fatal: Could not get current working directory: No such file or directory
Traceback (most recent call last):
  File "d:\pythons\371\lib\runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "d:\pythons\371\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "D:\pythons\371\Scripts\pipenv.exe\__main__.py", line 9, in <module>
  File "d:\pythons\371\lib\site-packages\pipenv\vendor\click\core.py", line 764, in __call__
    return self.main(*args, **kwargs)
  File "d:\pythons\371\lib\site-packages\pipenv\vendor\click\core.py", line 717, in main
    rv = self.invoke(ctx)
  File "d:\pythons\371\lib\site-packages\pipenv\vendor\click\core.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "d:\pythons\371\lib\site-packages\pipenv\vendor\click\core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "d:\pythons\371\lib\site-packages\pipenv\vendor\click\core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "d:\pythons\371\lib\site-packages\pipenv\vendor\click\decorators.py", line 64, in new_func
    return ctx.invoke(f, obj, *args, **kwargs)
  File "d:\pythons\371\lib\site-packages\pipenv\vendor\click\core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "d:\pythons\371\lib\site-packages\pipenv\vendor\click\decorators.py", line 17, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "d:\pythons\371\lib\site-packages\pipenv\cli\command.py", line 254, in install
    editable_packages=state.installstate.editables,
  File "d:\pythons\371\lib\site-packages\pipenv\core.py", line 1992, in do_install
    skip_lock=skip_lock,
  File "d:\pythons\371\lib\site-packages\pipenv\core.py", line 1244, in do_init
    pypi_mirror=pypi_mirror,
  File "d:\pythons\371\lib\site-packages\pipenv\core.py", line 1068, in do_lock
    lockfile=lockfile
  File "d:\pythons\371\lib\site-packages\pipenv\utils.py", line 626, in venv_resolve_deps
    dev=dev,
  File "d:\pythons\371\lib\site-packages\pipenv\utils.py", line 1311, in get_vcs_deps
    with locked_repository(requirement) as repo:
  File "d:\pythons\371\lib\contextlib.py", line 112, in __enter__
    return next(self.gen)
  File "d:\pythons\371\lib\site-packages\pipenv\utils.py", line 1447, in locked_repository
    with requirement.req.locked_vcs_repo(src_dir=src_dir) as repo:
  File "d:\pythons\371\lib\contextlib.py", line 112, in __enter__
    return next(self.gen)
  File "d:\pythons\371\lib\site-packages\pipenv\vendor\requirementslib\models\requirements.py", line 840, in locked_vcs_repo
    vcsrepo = self.get_vcs_repo(src_dir=src_dir)
  File "d:\pythons\371\lib\site-packages\pipenv\vendor\requirementslib\models\requirements.py", line 802, in get_vcs_repo
    vcsrepo.obtain()
  File "d:\pythons\371\lib\site-packages\pipenv\vendor\requirementslib\models\vcs.py", line 37, in obtain
    self.repo_instance.obtain(self.checkout_directory)
  File "d:\pythons\371\lib\site-packages\pipenv\patched\notpip\_internal\vcs\__init__.py", line 332, in obtain
    self.fetch_new(dest, url, rev_options)
  File "d:\pythons\371\lib\site-packages\pipenv\patched\notpip\_internal\vcs\git.py", line 198, in fetch_new
    self.run_command(['clone', '-q', url, dest])
  File "d:\pythons\371\lib\site-packages\pipenv\patched\notpip\_internal\vcs\__init__.py", line 456, in run_command
    spinner=spinner)
  File "d:\pythons\371\lib\site-packages\pipenv\patched\notpip\_internal\utils\misc.py", line 705, in call_subprocess
    % (command_desc, proc.returncode, cwd))
pipenv.patched.notpip._internal.exceptions.InstallationError: Command "git clone -q https://github.com/requests/requests.git C:\Users\steve\AppData\Local\Temp\requirementslib3op9tjg6\requests" failed with error code 128 in None       

Steps to replicate

Provide the steps to replicate (which usually at least includes the commands and the Pipfile).

  1. make a new directory
  2. cd into the new directory
  3. pipenv install -e git+https://github.com/requests/[email protected]#egg=requests

$ pipenv --support

Pipenv version: '2018.11.26'

Pipenv location: 'd:\\pythons\\371\\lib\\site-packages\\pipenv'

Python location: 'd:\\pythons\\371\\python.exe'

Python installations found:

  • 3.7.1: D:\pythons\371\python.exe
  • 2.7: D:\pythons\2715\python.exe

PEP 508 Information:

{'implementation_name': 'cpython',
 'implementation_version': '3.7.1',
 'os_name': 'nt',
 'platform_machine': 'AMD64',
 'platform_python_implementation': 'CPython',
 'platform_release': '10',
 'platform_system': 'Windows',
 'platform_version': '10.0.17134',
 'python_full_version': '3.7.1',
 'python_version': '3.7',
 'sys_platform': 'win32'}

System environment variables:

  • ACLOCAL_PATH
  • ALLUSERSPROFILE
  • ANSICON
  • ANSICON_DEF
  • APPDATA
  • COMMONPROGRAMFILES
  • COMPUTERNAME
  • COMSPEC
  • CHOCOLATEYINSTALL
  • CHOCOLATEYLASTPATHUPDATE
  • COMMONPROGRAMFILES(X86)
  • COMMONPROGRAMW6432
  • CONEMUANSI
  • CONEMUANSILOG
  • CONEMUARGS2
  • CONEMUARGS
  • CONEMUBACKHWND
  • CONEMUBASEDIR
  • CONEMUBUILD
  • CONEMUCONFIG
  • CONEMUDIR
  • CONEMUDRAWHWND
  • CONEMUDRIVE
  • CONEMUHWND
  • CONEMUHOOKS
  • CONEMUPID
  • CONEMUPALETTE
  • CONEMUSERVERPID
  • CONEMUTASK
  • CONEMUWORKDIR
  • CONEMUWORKDRIVE
  • DISPLAY
  • DRIVERDATA
  • EXEPATH
  • GOPATH
  • GOROOT
  • HOME
  • HOMEDRIVE
  • HOMEPATH
  • HOSTNAME
  • INFOPATH
  • LANG
  • LOCALAPPDATA
  • LOGONSERVER
  • MANPATH
  • MAYA_DEV
  • MSYSTEM
  • NUMBER_OF_PROCESSORS
  • OLDPWD
  • OS
  • OCULUSBASE
  • ONEDRIVE
  • ONEDRIVECONSUMER
  • PATH
  • PATHEXT
  • PKG_CONFIG_PATH
  • PLINK_PROTOCOL
  • PRINTER
  • PROCESSOR_ARCHITECTURE
  • PROCESSOR_IDENTIFIER
  • PROCESSOR_LEVEL
  • PROCESSOR_REVISION
  • PROGRAMFILES
  • PS1
  • PSMODULEPATH
  • PUBLIC
  • PWD
  • PROGRAMDATA
  • PROGRAMFILES(X86)
  • PROGRAMW6432
  • SESSIONNAME
  • SHELL
  • SHLVL
  • SSH_ASKPASS
  • SYSTEMDRIVE
  • SYSTEMROOT
  • TEMP
  • TERM
  • TMP
  • TMPDIR
  • UL
  • UL_BRANCH
  • UL_PROJECT
  • USERDOMAIN
  • USERDOMAIN_ROAMINGPROFILE
  • USERNAME
  • USERPROFILE
  • VS140COMNTOOLS
  • WINDIR
  • _
  • CONFIGSETROOT
  • P4PORT
  • PIP_DISABLE_PIP_VERSION_CHECK
  • PYTHONDONTWRITEBYTECODE
  • PIP_SHIMS_BASE_MODULE
  • PIP_PYTHON_PATH
  • PYTHONFINDER_IGNORE_UNSUPPORTED

Pipenvûspecific environment variables:

Debugûspecific environment variables:

  • PATH: C:\Users\steve\bin;C:\Program Files\Git\mingw64\bin;C:\Program Files\Git\usr\local\bin;C:\Program Files\Git\usr\bin;C:\Program Files\Git\usr\bin;C:\Program Files\Git\cmd;C:\Program Files\ConEmu\ConEmu\Scripts;C:\Program Files\ConEmu;C:\Program Files\ConEmu\ConEmu;C:\Program Files\Oculus\Support\oculus-runtime;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\ProgramData\Oracle\Java\javapath;C:\Program Files (x86)\Intel\iCLS Client;C:\Program Files\Intel\iCLS Client;C:\windows\system32;C:\windows;C:\windows\System32\Wbem;C:\windows\System32\WindowsPowerShell\v1.0;C:\Program Files\WIDCOMM\Bluetooth Software;C:\Program Files\WIDCOMM\Bluetooth Software\syswow64;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\Perforce;C:\Program Files\Perforce\DVCS;C:\Program Files\nodejs;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0;C:\Program Files (x86)\RemObjects Software\Elements\bin;C:\Program Files (x86)\QuickTime\QTSystem;C:\Users\steve\.dnx\bin;C:\Program Files\Microsoft DNX\Dnvm;C:\Program Files\Microsoft SQL Server\130\Tools\Binn;C:\ProgramData\chocolatey\bin;C:\Program Files (x86)\Skype\Phone;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0;C:\WINDOWS\System32\OpenSSH;C:\Go\bin;D:\pythons\371\Scripts;D:\pythons\371;C:\Users\steve\AppData\Local\Programs\Python\Launcher;C:\Program Files\Git\cmd;C:\Program Files (x86)\Intel\iCLS Client;C:\Program Files\Intel\iCLS Client;C:\windows\system32;C:\windows;C:\windows\System32\Wbem;C:\windows\System32\WindowsPowerShell\v1.0;C:\Program Files\WIDCOMM\Bluetooth Software;C:\Program Files\WIDCOMM\Bluetooth Software\syswow64;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\OpenVPN\bin;C:\Program Files\Perforce;C:\Program Files\Perforce\DVCS;C:\Program Files\nodejs;C:\Users\steve\AppData\Roaming\npm;D:\UL\class4\bin\python;D:\UL\class4\bin\python\Scripts;C:\Users\steve\AppData\Local\Microsoft\WindowsApps;C:\Users\steve\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Python 3.6;C:\Users\steve\AppData\Local\Programs\Python\Python36-32\Scripts;C:\python27;C:\Users\steve\go\bin;C:\Program Files\Git\usr\bin\vendor_perl;C:\Program Files\Git\usr\bin\core_perl
  • SHELL: C:/Program Files/Git/usr/bin/bash
  • LANG: en_US.UTF-8
  • PWD: C:/Users/steve/prj/dev2

Contents of Pipfile ('C:\Users\steve\prj\dev2\Pipfile'):

[[source]]
name = "pypi"
url = "https://pypi.org/simple"
verify_ssl = true

[dev-packages]

[packages]
requests = {editable = true,git = "https://github.com/requests/requests.git",ref = "v2.19"}

[requires]
python_version = "3.7"
@frostming
Copy link
Contributor

Can you try the command in the last line of output to see if it works?
git clone -q https://github.com/requests/requests.git

@theodox
Copy link
Author

theodox commented Jan 9, 2019

It fails if I am inside the project directory. If I cd out of the project directory, it succeeds

@theodox
Copy link
Author

theodox commented Jan 9, 2019

Incidentally I tried the exact same sequence on a different machine and this one worked.. Both windows running gitbash. The only obvious difference AFAICT is that the broken example runs under cmder and the working one runs under conemu...

@al-the-x
Copy link

I ran into a similar problem with pipenv and VCS deps as documented in #3404. My error message was different, but the cause -- VCS deps -- were the same. Removing / commenting the VCS deps allowed the lockfile to be generated correctly; restoring them caused the error.

Could you try patching pipenv locally as I have done in #3404 and report back about the effects?

@theodox
Copy link
Author

theodox commented Jan 18, 2019 via email

@techalchemy
Copy link
Member

hm, could be related to a number of possible issues w/r/t VCS dependency cloning but I believe this was a bug in requirementslib which is resolved, I'll push some updates shortly

@techalchemy techalchemy added Type: Bug 🐛 This issue is a bug. Category: VCS Relates to version control system dependencies. Type: Vendored Dependencies This issue affects vendored dependencies within pipenv. labels Jan 21, 2019
techalchemy added a commit that referenced this issue Jan 22, 2019
- Update gitignore entries for mypy config
- Update release task to add version after bumping but before release
- Fixes #3326 (going forward at least)
- Split out patching from vendoring so it can be done as a separate step
  if needed
- Update patches to account for updated packages
- Fixes #3432
- Fixes #2757
- Fixes #3305
- Fixes #2914
- Fixes #3439
- Fixes #3422
- Fixes #3378
- Fixes #3376
- Fixes #3315

Signed-off-by: Dan Ryan <[email protected]>
@techalchemy techalchemy added this to the March Release milestone Mar 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Category: VCS Relates to version control system dependencies. Type: Bug 🐛 This issue is a bug. Type: Vendored Dependencies This issue affects vendored dependencies within pipenv.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants