У меня есть эта проблема с тех пор, как я перешел с BASH на ZSH в macOS Catalina и попытался удалить python 2, что не удалось, поэтому я отказался от удаления python 2. И в результате Каждый раз, когда я создаю новый Virtualenv, все глобальные пакеты автоматически включаются в новый Virtualenv:
, вот моя конфигурация:
dlintin@Linns-MBP belajar_django % python --version
Python 2.7.16
dlintin@Linns-MBP belajar_django % python3 --version
Python 3.7.6
dlintin@Linns-MBP belajar_django % which python
/usr/bin/python
dlintin@Linns-MBP belajar_django % which python3
/usr/local/bin/python3
dlintin@Linns-MBP belajar_django % pip -V
pip 20.0.2 from /Library/Python/2.7/site-packages/pip (python 2.7)
dlintin@Linns-MBP belajar_django % pip3 -V
pip 19.0.3 from /Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.7/lib/python3.7/site-packages/pip (python 3.7)
dlintin@Linns-MBP belajar_django % which pip
pip: aliased to /usr/local/bin/pip
dlintin@Linns-MBP belajar_django % which pip3
/usr/bin/pip3
dlintin@Linns-MBP belajar_django % which virtualenv
/usr/local/bin/virtualenv
dlintin@Linns-MBP belajar_django % virtualenv test
created virtual environment CPython2.7.16.final.0-64 in 534ms
creator CPython2macOsFramework(dest=/Users/dlintin/DEVELOPMENT/DJANGO/belajar_django/test, clear=False, global=False)
seeder FromAppData(download=False, pip=latest, setuptools=latest, wheel=latest, via=copy, app_data_dir=/Users/dlintin/Library/Application Support/virtualenv/seed-app-data/v1)
activators PythonActivator,CShellActivator,FishActivator,PowerShellActivator,BashActivator
dlintin@Linns-MBP belajar_django % source test/bin/activate
(test) dlintin@Linns-MBP belajar_django % pip freeze
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. A future version of pip will drop support for Python 2.7. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
altgraph==0.17
appdirs==1.4.3
asn1crypto==1.3.0
backports.functools-lru-cache==1.6.1
bdist-mpkg==0.5.0
bonjour-py==0.3
cffi==1.14.0
configparser==4.0.2
contextlib2==0.6.0.post1
cryptography==2.8
cycler==0.10.0
distlib==0.3.0
enum34==1.1.9
filelock==3.0.12
future==0.18.2
importlib-metadata==1.5.0
importlib-resources==1.0.2
ipaddress==1.0.23
kiwisolver==1.1.0
macholib==1.14
matplotlib==2.2.5
modulegraph==0.18
numpy==1.16.6
pathlib2==2.3.5
pbr==5.4.4
py2app==0.21
pycparser==2.19
pyobjc-core==5.3
pyobjc-framework-Accounts==5.3
pyobjc-framework-AddressBook==5.3
pyobjc-framework-AppleScriptKit==5.3
pyobjc-framework-AppleScriptObjC==5.3
pyobjc-framework-Automator==5.3
pyobjc-framework-CFNetwork==5.3
pyobjc-framework-Cocoa==5.3
pyobjc-framework-Collaboration==5.3
pyobjc-framework-CoreData==5.3
pyobjc-framework-CoreLocation==5.3
pyobjc-framework-CoreServices==5.3
pyobjc-framework-CoreText==5.3
pyobjc-framework-DictionaryServices==5.3
pyobjc-framework-EventKit==5.3
pyobjc-framework-ExceptionHandling==5.3
pyobjc-framework-FSEvents==5.3
pyobjc-framework-InputMethodKit==5.3
pyobjc-framework-InstallerPlugins==5.3
pyobjc-framework-InstantMessage==5.3
pyobjc-framework-LatentSemanticMapping==5.3
pyobjc-framework-LaunchServices==5.3
pyobjc-framework-Message==5.3
pyobjc-framework-OpenDirectory==5.3
pyobjc-framework-PreferencePanes==5.3
pyobjc-framework-PubSub==5.3
pyobjc-framework-QTKit==5.3
pyobjc-framework-Quartz==5.3
pyobjc-framework-ScreenSaver==5.3
pyobjc-framework-ScriptingBridge==5.3
pyobjc-framework-SearchKit==5.3
pyobjc-framework-ServiceManagement==5.3
pyobjc-framework-Social==5.3
pyobjc-framework-SyncServices==5.3
pyobjc-framework-SystemConfiguration==5.3
pyobjc-framework-WebKit==5.3
pyOpenSSL==19.1.0
pyparsing==2.4.6
python-dateutil==2.8.1
pytz==2019.3
scandir==1.10.0
scipy==1.2.3
six==1.14.0
stevedore==1.32.0
subprocess32==3.5.4
typing==3.7.4.1
virtualenv==20.0.7
xattr==0.9.7
zipp==1.2.0
(test) dlintin@Linns-MBP belajar_django %