Change Python path for Python3 only

I am developing both Python 3 and Python 2.6 and installing both versions. However, with Python 3, the path to many good modules (time, math, ...) is not part of my Python path. I can add the directory to the path, but this is tedious.

Is there a way to constantly change the path for my Python 3 installation without affecting Python 2?

+6
source share
2 answers

Create a virtual environment: http://pypi.python.org/pypi/virtualenv/

Install the necessary packages in a virtual environment.

+3
source

If you cannot import the time, the math modules that are in stdlib, then your Python 3 installation will fail.

When you run python setup.py install files are installed in the right place for the python executable executable, whether it is system python or python from virtualenv. The same goes for pip .

You do not need to change any paths, just use the appropriate executables.

0
source

Source: https://habr.com/ru/post/919785/


All Articles