尝试在某些目录中运行鼻子测试时出错〜PyThreadState_Get:没有当前线程

时间:2019-03-08 15:43:42

标签: python anaconda nose

我正在尝试使用/opt/moose/miniconda/bin/python环境(由我的工作设置的环境)来处理一些单独的代码,并且在尝试使用鼻子模块运行测试时遇到错误。

要回到我的问题开始的地方,我在运行时收到此错误:

pip install nose

Could not install packages due to an EnvironmentError: [Errno 13] Permission denied: '/opt/moose/miniconda/lib/python2.7/site-packages/nose'
Consider using the `--user` option or check the permissions.

然后我跑了

pip install nose --user

The scripts nosetests and nosetests-2.7 are installed in '~/.local/bin' which is not on PATH.
  Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.

然后我将其添加到〜/ .bashrc文件中

export PATH=$PATH:~/.local/bin

现在,当我在主目录中打开python解释器时,我可以成功运行:

Python 2.7.15 |Anaconda, Inc.| (default, Dec 14 2018, 13:10:39)
[GCC 4.2.1 Compatible Clang 4.0.1 (tags/RELEASE_401/final)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import nose
>>> nose.main()


----------------------------------------------------------------------
Ran 0 tests in 0.002s


OK

但是,当我移至要在其中实际运行测试的目录时,我得到:

$ cd Documents/projects/neml
$ python
Python 2.7.15 |Anaconda, Inc.| (default, Dec 14 2018, 13:10:39)
[GCC 4.2.1 Compatible Clang 4.0.1 (tags/RELEASE_401/final)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import nose
>>> nose.main()

Fatal Python error: PyThreadState_Get: no current thread
Abort trap: 6

任何想法我为什么会收到此错误,似乎我在两个目录中都运行相同的python。这似乎是一个环境问题,但如果不是,请指出正确的方向。谢谢。

0 个答案:

没有答案