跳到主要内容
版本:0.17.0+

python bugfix

  1. FIXME: Python is deprecating distutils.cfg
  2. FIXED: virtualenv not work
  3. FIXED: pip not work
  4. BEST-PRACTICE: move the virtual python environment then not working
  5. pip freeze wield path
  6. python virtualenv conflicts with anaconda

FIXME: Python is deprecating distutils.cfg

ref

FIXED: virtualenv not work

When using pip install virtualenv, the virtualenv command may not work if your pip is from system-wide python.

The best idea is to use a USER-LEVEL python, e.g:

brew install python
which python

pip install virtualenv
virtualenv -h

Then it may work.

FIXED: pip not work

Run the following, and it would replace the old pip package with the new one.

# replace to your target python if need
# and it may be a little slow, but do work
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py && python3 get-pip.py && rm get-pip.py

ref

BEST-PRACTICE: move the virtual python environment then not working

reason:

picture 1

resolution:

The activate line in bin/activate is not changed when the directory has moved.

So just change it to the new correct place and source it, then ok!

pip freeze wield path

 pip list --format=freeze > requirements.txt

reference: https://stackoverflow.com/a/62886215/9422455

python virtualenv conflicts with anaconda

reference: https://stackoverflow.com/a/38226816/9422455