No evidence of run when using pipenv run.
See original GitHub issueIssue description
When running a python script using pipenv run nothing happens - no print output is generated. However, when running same script inside pipenv shell everything seems to be fine.
Expected result
Both pipenv run main.py and pipenv shell and then python main.py should show the same output/
Actual result
When possible, provide the verbose output (--verbose
), especially for locking and dependencies resolving issues.
Steps to replicate
Provide the steps to replicate (which usually at least includes the commands and the Pipfile).
main.py:
import os, sys
print("PYTHON =", sys.executable)
print("VERSION =", sys.version)
print("HTTP_PROXY =", os.environ.get("HTTP_PROXY"))
print("HTTPS_PROXY =", os.environ.get("HTTPS_PROXY"))
print("REQUESTS_CA_BUNDLE =", os.environ.get("REQUESTS_CA_BUNDLE"))
print("CURL_CA_BUNDLE =", os.environ.get("CURL_CA_BUNDLE "))
Pipfile
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"
[packages]
requests = "*"
certifi = "*"
[dev-packages]
[requires]
python_version = "3.9"
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:7 (1 by maintainers)
Top Results From Across the Web
Using 'pipenv run' can I run a script outside of the project folder?
When in that folder and not in the pipenv virtual enviroment. I can use the command pipenv run script.py and it works.
Read more >A tool all Python developers should be using - Medium
This post is about my first experience from a blank canvas to production ready code using pipenv as the package manager plus testing...
Read more >Frequently Encountered Pipenv Problems - Read the Docs
Here are some common questions people have using Pipenv. Please take a look below and see if they resolve your problem. Note. Make...
Read more >Common Pipenv Errors - Towards Data Science
Notice after running ls there is no Pipfile or Pipfile.lock generated. That is because Pipenv has found the Pipfile higher up in the...
Read more >Pipenv run vs Pipenv shell - Anselmos Blog
Pipenv has a run and shell, but which one should I use ? ... for the next RUN command or any other command...
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
pipenv run main.py
is not working becausepipenv run
executes the following commands in your virtual environment. So, you have to dopipenv run python main.py
for the example. Or you can set custom script shortcuts inPipfile
to run directly withpipenv run <your-custom-script>
. Check here for the detail.Hi
It turned out it’s not working on one of my computers because something was wrong with file associations in Windows. So every python script had to be prefixed with python. After I fixed this then I could use
pipenv run script.py
with the results just as expected.