Issue
I have this directory structure:
code/
├── some_script.py
├── Pipfile
├── Pipfile.lock
└── subdirectory/
└── script_to_run.py
Inside subdirectory/
directory, I want to run script_to_run.py
, however when I pipenv run python3 script_to_run.py
I get the problem that pipenv assumes I'm in the code/
directory, rather than the subdirectory/
directory.
How do I generate a new virtualenv for subdirectory/
with pipenv?
Solution
cd subdirectory
touch Pipfile
pipenv run python3 script_to_run.py
This will generate a new virtualenv for this subdirectory.
Answered By - Connor Answer Checked By - Dawn Plyler (WPSolving Volunteer)