Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pipenv --python $PYTHON_VERSION #770

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

yssource
Copy link

@yssource yssource commented Mar 1, 2021

⠙ Creating virtual environment...FileNotFoundError: [Errno 2] No such file or directory: '/shims/python'

Above could happen, if it is to use python from pyenv, instead of the one from system.
So, I think it is best to prepend pipenv --python $python_version before pipenv install --venv.

@yssource yssource force-pushed the feature/layout_pipenv_with_python_version branch from 0bee733 to 38377fc Compare March 1, 2021 15:34
@zimbatm
Copy link
Member

zimbatm commented Mar 1, 2021

What does pipenv --python $python_version do exactly? It seems a bit racey if it switches the python version on the system or user-level.

@yssource
Copy link
Author

yssource commented Mar 2, 2021

according to the pipenv document

  1. before installing dependent packages, create a project.
Usage Examples:
   Create a new project using Python 3.7, specifically:
   $ pipenv --python 3.7

  1. https://pipenv.pypa.io/en/latest/basics/#specifying-versions-of-python
  2. https://pipenv.pypa.io/en/latest/diagnose/#pipenv-does-not-respect-pyenvs-global-and-local-python-versions

I think many people could install different python versions using pyenv. And actually the python path was set to be
/home/User/.pyenv/shims/python, instead of the system path /usr/bin/python.

If the pyenv is installed, and python version is not specified, pipenv install could get the default python version from /shims/python, which cause ⠙ Creating virtual environment...FileNotFoundError: [Errno 2] No such file or directory: '/shims/python'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants