Python 使用numpy的问题

Python 使用numpy的问题,python,numpy,pypy,Python,Numpy,Pypy,我已经在同一台机器上安装了pypy(linux2上的pypy 2.7.13、[pypy 6.0.0和GCC 6.2.0 20160901])和Python(linux2上的PyPython 2.7.14[GCC 4.8.4]) 我能够无缝地将numpy与pypy一起使用。然而,对于python,我得到了以下错误 Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/u

我已经在同一台机器上安装了pypy(linux2上的pypy 2.7.13、[pypy 6.0.0和GCC 6.2.0 20160901])和Python(linux2上的PyPython 2.7.14[GCC 4.8.4])

我能够无缝地将numpy与pypy一起使用。然而,对于python,我得到了以下错误

Traceback (most recent call last):
File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python2.7/dist-packages/numpy/__init__.py", line 160, in <module>
    from . import random
  File "/usr/local/lib/python2.7/dist-packages/numpy/random/__init__.py", line 99, in <module>
    from .mtrand import *
ImportError: /usr/local/lib/python2.7/dist-packages/numpy/random/mtrand.so: undefined symbol: PyFPE_jbuf
我尝试的另一个选项是:
sudopip安装numpy
。我发现以下错误:

Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 python-numpy : Depends: python (>= 2.7) but it is not going to be installed
                Depends: python (< 2.8) but it is not going to be installed
                Depends: python:any (>= 2.7.1-0ubuntu2)
                Depends: python2.7:any
Command "/usr/bin/pypy -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-k3GbV2/numpy/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-record-8SqQxW/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-install-k3GbV2/numpy/
/usr/local/lib/pypy2.7/dist-packages/pip/_vendor/urllib3/util/ssl_.py:160: 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/advanced-usage.html#ssl-warnings
  InsecurePlatformWarning
注意上面块中的以下内容:/usr/local/lib/pypy2.7/dist-packages/pip/我的pip似乎使用了一些pypy2.7 lib


我不太清楚发生了什么事。任何帮助都将不胜感激。如果您需要任何进一步的信息,请告诉我。

由于我以前收到过此警告,所以只需回答问题的最后一部分:

不安全平台警告真正的SSLContext对象不可用

要避免这种情况,您可以尝试:

pip install pyOpenSSL 

如果您将
sudo-pip-install
sudo-apt-install
混合使用,那么您的系统肯定会出问题。您可能希望探索使用
virtualenv
来设置一个自包含的python,它完全位于一个文件夹中,可以使用usr级别
pip安装进行管理,无需
sudo

谢谢。我试过了,但在安装时遇到了同样的不安全平台警告错误。