Pipenv doesn't install dependencies of top-level dependencies from pre-existing Pipfile
See original GitHub issueHere is the story: I’m migrating from old requirements.txt
to a brand new Pipfile
. First time I run pipenv install
, it said me that there is requirements.txt
and it will convert it. OK, I thought. Next, it installed dependencies.
Then I tried to play with my project, run some code, and it fails due to missing imports. “It is strange”, I thought. Then I run pipenv graph
and find that some of dependencies of direct dependencies of my project was not installed.
I did a bunch of experiments combining different options, pythons (2.7, 3.6),Pipfile
’s (and .lock
’s) and still can’t figure out why pipenv
doesn’t install all the dependencies.
Then I do stupid thing: I grabbed list of top-level deps, removed Pipfile{,.lock}
and requirements.txt
and installed all of them step-by-step with pipenv install <package>
. Funny, but it worked.
Describe your environment
- Solus
- Python version: Python 2.7.14
- Pipenv version: pipenv, version 10.1.0
Expected result
I expect that when I install deps from pre-existing Pipfile
, pipenv
install all of them, including deps of top-level deps.
Actual result
Some of deps of top-level deps are not installed at all.
Steps to replicate
Pipfile
:
[[source]]
url = "https://pypi.python.org/simple"
verify_ssl = true
name = "pypi"
[packages]
cryptography = "*"
APScheduler = "==3.0.5"
"pathlib2" = "*"
[dev-packages]
[requires]
python_version = "2.7"
Then:
$ pipenv install --two
$ pipenv graph | egrep 'installed: \?'
Trying to import:
$ python -m pathlib2
Traceback (most recent call last):
File "/usr/lib64/python2.7/runpy.py", line 174, in _run_module_as_main
"__main__", fname, loader, pkg_name)
File "/usr/lib64/python2.7/runpy.py", line 72, in _run_code
exec code in run_globals
File "<venv>/lib/python2.7/site-packages/pathlib2.py", line 45, in <module>
from scandir import scandir as os_scandir
ImportError: No module named scandir
Issue Analytics
- State:
- Created 6 years ago
- Comments:9 (3 by maintainers)
Also, it seems like even if I manually re-installed package to fix dependencies problem, such originally missing deps does not locked in
Pipfile.lock
. Which means that the main goal ofpipenv
- reproducible, deterministic reestablishment of application environment - not achieved at all.I updated to the latest version 11.5.2 (not sure why brew gave me an older version yesterday).
I’ve also become aware that people can get tricked if there is an existing
Pipfile.lock
with missing dependencies - then of course you are going to get missing dependencies when youpipenv install
because pipenv install only looks at the lockfile.So I have been careful to
pipenv update
which should fix up (add any needed) dependencies in the lockfile, yet I am still getting missing dependencies from the lockfile, and thus from thepipenv graph
. I totally reinstalled pipenv using brew,pipenv --rm
to remove the pipenv virtual env and rebooted, treid again, but am still getting the missing dependencies. So I ran update with the -v verbose option and saw:The secondary dependencies are coming up blank? On my other mac machine, the dependencies detect what’s needed and go through various ‘rounds’ and it all works ok. The machine which has problems is a solid Mac machine with python 2 and python 3 installed using brew. No sure how to debug this or whether this deserves another open issue (apologies if I’ve hijacked the OP, but it seems related).