Pip not working with Python3.6 (Ubuntu 14)
我有很多问题,我不懂python及其不同的版本。 我正在做一个CS50 Web在线课程,我需要pip3用于python 3.6或更高版本。 情况是我不能使用pip for python 3.6。
在
/usr/local/bin/pip: /usr/bin/python: defect interpreter. File could
been not found.
如何在python3.6版本中使用pip命令?
对于课程项目,我应该使用
1 2 3 4 | Flask Flask-Session psycopg2 SQLAlchemy |
我尝试使用
Traceback (most recent call last): File"/usr/lib/python3.6/runpy.py", line 183, in _run_module_as_main
mod_name, mod_spec, code = _get_module_details(mod_name, _Error) File"/usr/lib/python3.6/runpy.py", line 142, in _get_module_details
return _get_module_details(pkg_main_name, error) File"/usr/lib/python3.6/runpy.py", line 109, in _get_module_details
import(pkg_name) File"/usr/lib/python3/dist-packages/pip/init.py", line 59, in
from pip.log import logger File"/usr/lib/python3/dist-packages/pip/log.py", line 9, in
import colorama, pkg_resources File"", line 971, in _find_and_load File"", line 955, in _find_and_load_unlocked File
"", line 656, in _load_unlocked File
"", line 626, in
_load_backward_compatible File"/usr/share/python-wheels/setuptools-3.3-py2.py3-none-any.whl/pkg_resources.py",
line 1479, in
register_loader_type(importlib_bootstrap.SourceFileLoader, DefaultProvider) AttributeError: module 'importlib._bootstrap' has no
attribute 'SourceFileLoader' Error in sys.excepthook: Traceback (most
recent call last): File
"/usr/lib/python3/dist-packages/apport_python_hook.py", line 63, in
apport_excepthook
from apport.fileutils import likely_packaged, get_recent_crashes File"/usr/lib/python3/dist-packages/apport/init.py", line 5, infrom apport.report import Report File"/usr/lib/python3/dist-packages/apport/report.py", line 30, in
import apport.fileutils File"/usr/lib/python3/dist-packages/apport/fileutils.py", line 23, in
from apport.packaging_impl import impl as packaging File"/usr/lib/python3/dist-packages/apport/packaging_impl.py", line 20, in
import apt File"/usr/lib/python3/dist-packages/apt/init.py", line 23, in
import apt_pkg ModuleNotFoundError: No module named 'apt_pkg'Original exception was: Traceback (most recent call last): File
"/usr/lib/python3.6/runpy.py", line 183, in _run_module_as_main
mod_name, mod_spec, code = _get_module_details(mod_name, _Error) File"/usr/lib/python3.6/runpy.py", line 142, in _get_module_details
return _get_module_details(pkg_main_name, error) File"/usr/lib/python3.6/runpy.py", line 109, in _get_module_details
import(pkg_name) File"/usr/lib/python3/dist-packages/pip/init.py", line 59, in
from pip.log import logger File"/usr/lib/python3/dist-packages/pip/log.py", line 9, in
import colorama, pkg_resources File"", line 971, in _find_and_load File"", line 955, in _find_and_load_unlocked File
"", line 656, in _load_unlocked File
"", line 626, in
_load_backward_compatible File"/usr/share/python-wheels/setuptools-3.3-py2.py3-none-any.whl/pkg_resources.py",
line 1479, in
register_loader_type(importlib_bootstrap.SourceFileLoader, DefaultProvider) AttributeError: module 'importlib._bootstrap' has no
attribute 'SourceFileLoader' [1]+ Fertig gedit
requirements.txt
我感谢任何帮助。 非常感谢!
卡洛斯
您可能会遇到系统上安装的pip落后的情况。
如果您使用的是
1 2 | virtualenv --python=python3 venv venv/bin/pip install --upgrade pip |