question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

pipenv does not create Pipfile and Pipfile.lock if they exist in parent directories

See original GitHub issue
Describe your environment
  1. OS Type - OSX - Darwin Kernel Version 16.7.0
  2. Python version: $ python -V - Python 2.7.10
  3. 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:closed
  • Created 6 years ago
  • Comments:10 (4 by maintainers)

github_iconTop GitHub Comments

18reactions
halloleocommented, May 3, 2018

Another, newer way to do it is to set the env variable PIPENV_NO_INHERIT. Then Pipenv won’t look in the parent directory.

18reactions
uranusjrcommented, Jan 17, 2018

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 the tools 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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found