debian - Python 3.5 install pyvenv -
i trying virtual environment repo requires python 3.5. using debian, , can tell, python 3.5 not have aptitude package. after reading posts, recommended download 3.5 source code , compile it.
after running make , install, python3.5 installed /usr/local/bin. added $path variable.
here ran problems. after ran:
$ cd project-dir $ pyvenv env $ source env/bin/activate $ pip install -r requirements.txt
i getting issues needing sudo install proper packages. ran:
$ pip
and turns out pip still using /usr/local/bin version of pip.
$ echo $path
returned
/home/me/project-dir/env/bin:/usr/local/bin:/usr/bin:/bin: ...
i assuming because /usr/local path came after virtual environment's path in path variable, using version of pip instead of virtual environments.
what best way run correct version of pip within virtualenv? 2 options can think of moving binaries on /usr/bin or modifying activate script in virtual env place virtualenv path after /usr/local.
option 1 can upgrade pip in virtual environment manually executing
pip install -u pip
option 2 method upgrade pip inside package python -m ensurepip --upgrade
indeed upgrade pip version in system (if lower version in ensurepip).
you facing problem, because venv uses ensurepip add pip new environments:
unless --without-pip option given, ensurepip invoked bootstrap pip virtual environment.
ensurepip package won't download internet or grab files anywhere else, because required components included package. doing add security flaws , unsupported.
ensurepip not designed give newest pip, "a" pip. newest 1 use manual way @ beginning of post.
to check ensurepip version can type python console import ensurepip print(ensurepip.version())
more findings further reading:
Comments
Post a Comment