Python 正在尝试导入';ruamel.yaml';lib导致';ImportError:没有名为ruamel.yaml'的模块;错误

Python 正在尝试导入';ruamel.yaml';lib导致';ImportError:没有名为ruamel.yaml'的模块;错误,python,yaml,importerror,ruamel.yaml,Python,Yaml,Importerror,Ruamel.yaml,我跑了一辆 pip install ruamel.yaml 当我试着去做的时候 import ruamel.yaml 我得到一个错误: ImportError: No module named ruamel.yaml python 2.7 我的pip“冻结”的输出: nose==1.3.7 numpy==1.12.1 pandas==0.23.3 python-dateutil==2.7.3 pytz==2018.5 PyYAML==3.13 ruamel.ordereddict==0.4

我跑了一辆

pip install ruamel.yaml
当我试着去做的时候

import ruamel.yaml
我得到一个错误:

ImportError: No module named ruamel.yaml
python 2.7

我的pip“冻结”的输出:

nose==1.3.7
numpy==1.12.1
pandas==0.23.3
python-dateutil==2.7.3
pytz==2018.5
PyYAML==3.13
ruamel.ordereddict==0.4.13
ruamel.yaml==0.15.46
six==1.11.0
Linux(Solus):

$uname
Linux
$virtualenv-p/opt/python/2.7/bin/python/var/tmp/so_51581941
使用解释器/opt/python/2.7/bin/python运行virtualenv
/var/tmp/so_51581941/bin/python中新的python可执行文件
安装setuptools、pip、wheel…完成。
$source/var/tmp/so_51581941/bin/activate
(so_51581941)$pip安装ruamel.yaml
收集ruamel.yaml
正在下载https://files.pythonhosted.org/packages/b1/30/3d5c9bc3955136027177a7bbe4cf9ec94504d8cba851ce391eb2e9633db5/ruamel.yaml-0.15.46-cp27-cp27mu-manylinux1_x86_64.whl (592kB)
100% |████████████████████████████████| 593kB 2.9MB/s

收集ruamel.ordereddict;platform_python_implementation==“CPython”和python_version您运行的是哪个操作系统,您使用的是哪个版本的
virtualenv
(如果不是在Windows下运行的话)?仍然没有更新您的帖子以及所有缺失的信息来重现您所做的事情并能够有意义地帮助您。PEBCAK?@MohseMalka如果这对你有效,请接受答案。这是让其他人知道这有一个可接受的答案/解决方案的方式(无需阅读评论)。这也会出现在搜索页面中,等等。
$ uname 
Linux
$ virtualenv -p /opt/python/2.7/bin/python /var/tmp/so_51581941
Running virtualenv with interpreter /opt/python/2.7/bin/python
New python executable in /var/tmp/so_51581941/bin/python
Installing setuptools, pip, wheel...done.
$ source /var/tmp/so_51581941/bin/activate
(so_51581941) $ pip install ruamel.yaml
Collecting ruamel.yaml
  Downloading https://files.pythonhosted.org/packages/b1/30/3d5c9bc3955136027177a7bbe4cf9ec94504d8cba851ce391eb2e9633db5/ruamel.yaml-0.15.46-cp27-cp27mu-manylinux1_x86_64.whl (592kB)
    100% |████████████████████████████████| 593kB 2.9MB/s 
Collecting ruamel.ordereddict; platform_python_implementation == "CPython" and python_version <= "2.7" (from ruamel.yaml)
  Downloading https://files.pythonhosted.org/packages/f3/2c/fa6d75dc459b371ed3b88fdbf8042785ce1655073c884fd97bdbb9f48e01/ruamel.ordereddict-0.4.13-cp27-cp27mu-manylinux1_x86_64.whl (99kB)
    100% |████████████████████████████████| 102kB 3.8MB/s 
Installing collected packages: ruamel.ordereddict, ruamel.yaml
Successfully installed ruamel.ordereddict-0.4.13 ruamel.yaml-0.15.46
(so_51581941) $ pip freeze
ruamel.ordereddict==0.4.13
ruamel.yaml==0.15.46
(so_51581941) $ python -c "import ruamel.yaml"
(so_51581941) $ deactivate
$ 
$ uname
Darwin
$ which python2.7
/Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7
$ virtualenv -p /Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7 /var/tmp/so_51581941
Running virtualenv with interpreter /Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7
New python executable in /var/tmp/so_51581941/bin/python
Installing setuptools, pip, wheel...done.
$ source /var/tmp/so_51581941/bin/activate
(so_51581941) $ pip install ruamel.yaml
Collecting ruamel.yaml
  Downloading https://files.pythonhosted.org/packages/cd/0e/0e21d703e775f94447d6889ec231309679cb684347868b4b1e73e08510fd/ruamel.yaml-0.15.46-cp27-cp27m-macosx_10_9_x86_64.whl (236kB)
    100% |████████████████████████████████| 245kB 3.5MB/s 
Collecting ruamel.ordereddict; platform_python_implementation == "CPython" and python_version <= "2.7" (from ruamel.yaml)
  Downloading https://files.pythonhosted.org/packages/b1/8f/3b1b407ff387e006a4a33e62182b212077bed41676451d60327955a50c3c/ruamel.ordereddict-0.4.13.tar.gz (57kB)
    100% |████████████████████████████████| 61kB 3.6MB/s 
Building wheels for collected packages: ruamel.ordereddict
  Running setup.py bdist_wheel for ruamel.ordereddict ... done
  Stored in directory: /Users/builder/Library/Caches/pip/wheels/5e/76/38/d2f83b281e02aa1bac95b2663ea19ed022440033b61e47ac3a
Successfully built ruamel.ordereddict
Installing collected packages: ruamel.ordereddict, ruamel.yaml
Successfully installed ruamel.ordereddict-0.4.13 ruamel.yaml-0.15.46
(so_51581941) $ pip freeze
ruamel.ordereddict==0.4.13
ruamel.yaml==0.15.46
(so_51581941) $ python -c "import ruamel.yaml"
(so_51581941) $ deactivate
$ 
$ python -c "import sys; print(sys.platform)"
win32

$ virtualenv -p c:\Python\2.7\python.exe %TMP%\so_51581941
Running virtualenv with interpreter c:\Python\2.7\python.exe
New python executable in C:\Users\Anthon\AppData\Local\Temp\so_51581941\Scripts\
python.exe
Installing setuptools, pip, wheel...done.

$ %TMP%\so_51581941\Scripts\activate

(so_51581941) $ pip install ruamel.yaml
Collecting ruamel.yaml
  Downloading https://files.pythonhosted.org/packages/70/79/337d043310c8b9fe7978a9ab72b7838b8088785a66a69cb6558771a19969/ruamel.yaml-0.15.46-cp27-cp27m-win_amd64.whl (208kB)
    100% |################################| 215kB 1.7MB/s
Collecting ruamel.ordereddict; platform_python_implementation == "CPython" and python_version <= "2.7" (from ruamel.yaml)
  Downloading https://files.pythonhosted.org/packages/2b/d4/b1ec24d4cc8669bb01e303573a5dd9a85b4c116a53c225749fbb9bce0ac9/ruamel.ordereddict-0.4.13-cp27-cp27m-win_amd64.whl
Installing collected packages: ruamel.ordereddict, ruamel.yaml
Successfully installed ruamel.ordereddict-0.4.13 ruamel.yaml-0.15.46

(so_51581941) $ pip freeze
ruamel.ordereddict==0.4.13
ruamel.yaml==0.15.46

(so_51581941) $ python -c "import ruamel.yaml"

(so_51581941) $ deactivate
$