pipenv does not create Pipfile and Pipfile.lock if they exist in parent directories
See original GitHub issueDescribe your environment
- OS Type - OSX - Darwin Kernel Version 16.7.0
- Python version:
$ python -V
- Python 2.7.10 - Pipenv version:
$ pipenv --version
- pipenv, version 9.0.3
Steps to replicate:
cd ~/
pipenv install <any-package>
mkdir hello
cd hello
pipenv install <any-package>
Expected result
Pipfile
and Pipfile.lock
should be created in the current directory (~/hello
in the above example)
Actual result
If Pipfile
exist in home (parent) directory, no Pipfile
or Pipfile.lock
is created in current directory. pipenv
keeps adding packages to the parent Pipfile (in home directory in above example). And pipenv --where
returns home directory path.
Issue Analytics
- State:
- Created 6 years ago
- Comments:10 (4 by maintainers)
Top Results From Across the Web
Pipenv not creating Pipfile and not creating environment in ...
After deleting the Pipfile and the Pipfile.lock from the home directory ~/ I was able to create a new virtual environment without conflict....
Read more >Common Pipenv Errors and How to Solve Them: Why Won't it ...
Locking Issue: Pipfile Contains a Reference to an Inexistent Package ... Pipfile won't lock when it tries to install packages that don't exist,...
Read more >Advanced Usage of Pipenv - Read the Docs
Dependencies of wheels provided in a Pipfile will not be captured by $ pipenv lock . There are some known issues with using...
Read more >pipenv Documentation - Read the Docs
This will create a Pipfile if one doesn't exist. If one does exist, it will automatically be edited with the new package you...
Read more >A Cheatsheet for Python's Pipenv - IMTorg Kbase
You may want to generate requirements.txt file from existing Pipfile.lock without locking. When you run pipenv lock -r it ignores existing ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Another, newer way to do it is to set the env variable
PIPENV_NO_INHERIT
. Then Pipenv won’t look in the parent directory.This is deliberate, and normally is what people want. Say you’re developing a package with a
tools
directory. It would be strange if you can’t run scripts inside thetools
subdirectory, only in the root. The Pipfile should work for all directories inside that project.You can create a Pipfile manually inside
hello
to get the behaviour you want.