我正在尝试通过pip安装vowpalwabbit:
sudo pip install vowpalwabbit
The directory '/home/user/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/home/user/.cache/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Collecting vowpalwabbit
Downloading https://files.pythonhosted.org/packages/56/45/278a8427aa859888b3fb3e3debeea086557df8def22a23561bfe45e1fb03/vowpalwabbit-8.5.0.tar.gz (1.5MB)
100% |\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588| 1.5MB 938kB/s
Installing collected packages: vowpalwabbit
Running setup.py install for vowpalwabbit ... done
Successfully installed vowpalwabbit-8.5.0
You are using pip version 9.0.1, however version 10.0.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
但是得到错误:
python
Python 3.6.4 |Anaconda, Inc.| (default, Jan 16 2018, 18:10:19)
[GCC 7.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import vowpalwabbit
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'vowpalwabbit'
更新
检查python2:
python2
Python 2.7.6 (default, Oct 26 2016, 20:30:19)
[GCC 4.8.4] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import vowpalwabbit
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named vowpalwabbit
which python
/home/user/anaconda3/bin/python
which pip
/home/user/anaconda3/bin/pip
python -m pip install vopalwabbit
Collecting vopalwabbit
Could not find a version that satisfies the requirement vopalwabbit (from versions: )
No matching distribution found for vopalwabbit
卸载时有些奇怪:
pip uninstall vopalwabbit
Skipping vopalwabbit as it is not installed.
UPDATE2:
最后2个命令有拼写错误,这里是实际输出:
sudo python -m pip install vowpalwabbit
The directory '/home/user/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/home/user/.cache/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Collecting vowpalwabbit
/usr/local/lib/python2.7/dist-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:318: SNIMissingWarning: An HTTPS request has been made, but the SNI (Subject Name Indication) extension to TLS is not available on this platform. This may cause the server to present an incorrect TLS certificate, which can cause validation failures. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/security.html#snimissingwarning.
SNIMissingWarning
/usr/local/lib/python2.7/dist-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:122: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/security.html#insecureplatformwarning.
InsecurePlatformWarning
/usr/local/lib/python2.7/dist-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:122: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/security.html#insecureplatformwarning.
InsecurePlatformWarning
/usr/local/lib/python2.7/dist-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:122: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/security.html#insecureplatformwarning.
InsecurePlatformWarning
Downloading https://files.pythonhosted.org/packages/56/45/278a8427aa859888b3fb3e3debeea086557df8def22a23561bfe45e1fb03/vowpalwabbit-8.5.0.tar.gz (1.5MB)
100% |\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588| 1.5MB 787kB/s
Installing collected packages: vowpalwabbit
Running setup.py install for vowpalwabbit ... done
Successfully installed vowpalwabbit-8.5.0
You are using pip version 9.0.1, however version 10.0.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
import vowpalwabbit
可以在python2中运行。
答案 0 :(得分:2)
这是你的发行版上有两个版本的python的时间问题。 Vopalwabbit安装在您系统上的2.7版本的python上,而不是3.6。
要正确安装,你必须这样称呼它:
python3 -m pip install vopalwabbit