Menggunakan virtualenv , saya menjalankan proyek saya dengan versi default Python (2.7). Pada satu proyek, saya perlu menggunakan Python 3.4.
Saya dulu brew install python3
menginstalnya di Mac saya. Sekarang, bagaimana cara membuat virtualenv yang menggunakan versi baru?
misalnya sudo virtualenv envPython3
Jika saya mencoba:
virtualenv -p python3 test
Saya mendapat:
Running virtualenv with interpreter /usr/local/bin/python3
Using base prefix '/usr/local/Cellar/python3/3.4.0_1/Frameworks/Python.framework/Versions/3.4'
New python executable in test/bin/python3.4
Also creating executable in test/bin/python
Failed to import the site module
Traceback (most recent call last):
File "/Users/user/Documents/workspace/test/test/bin/../lib/python3.4/site.py", line 67, in <module>
import os
File "/Users/user/Documents/workspace/test/test/bin/../lib/python3.4/os.py", line 634, in <module>
from _collections_abc import MutableMapping
ImportError: No module named '_collections_abc'
ERROR: The executable test/bin/python3.4 is not functioning
ERROR: It thinks sys.prefix is '/Users/user/Documents/workspace/test' (should be '/Users/user/Documents/workspace/test/test')
ERROR: virtualenv is not compatible with this system or executable