简体   繁体   English

Anaconda Python 3.5脚本的问题

[英]Issue with Anaconda Python 3.5 script

Having an issue with a fresh install of Anaconda. 全新安装Anaconda时遇到问题。 I created an environment with Python 3.5 and trying to run a simple script but for whatever reason I am seeing an issue during the import statements. 我使用Python 3.5创建了一个环境,并尝试运行一个简单的脚本,但是由于任何原因,我在import语句期间都遇到了问题。

import os
import csv
import numpy as np
import scipy

So there are other reports of similar errors on SO but they are from awhile back and do not seem to be linked to Anaconda. 因此,还有关于SO类似错误的其他报道,但它们是从前传来的,似乎与Anaconda无关。 I have NOT seen this before on my laptop )running el capitan) also running miniconda (btw this is happening on a mac osx el capitan). 我以前没有在笔记本电脑上运行过capitan的笔记本电脑上看到过此消息,也正在运行miniconda(顺便说一下,这是在mac osx el capitan上发生的)。 I cannot understand why anaconda would try calling usr/local/lib/python2.7 while the environment is in python 3.5. 我不明白为什么当环境在python 3.5中时,anaconda会尝试调用usr / local / lib / python2.7。 Is this normal? 这正常吗? Any assistance would be greatly appreciated!!! 任何帮助将不胜感激!

    Traceback (most recent call last):
  File "myTest.py", line 11, in <module>
    import scipy
  File "/Users/dennis/anaconda/envs/test/lib/python3.5/site-packages/scipy/__init__.py", line 61, in <module>
    from numpy import show_config as show_numpy_config
  File "/usr/local/lib/python2.7/site-packages/numpy/__init__.py", line 180, in <module>
    from . import add_newdocs
  File "/usr/local/lib/python2.7/site-packages/numpy/add_newdocs.py", line 13, in <module>
    from numpy.lib import add_newdoc
  File "/usr/local/lib/python2.7/site-packages/numpy/lib/__init__.py", line 8, in <module>
    from .type_check import *
  File "/usr/local/lib/python2.7/site-packages/numpy/lib/type_check.py", line 11, in <module>
    import numpy.core.numeric as _nx
  File "/usr/local/lib/python2.7/site-packages/numpy/core/__init__.py", line 14, in <module>
    from . import multiarray
ImportError: dlopen(/usr/local/lib/python2.7/site-packages/numpy/core/multiarray.so, 2): Symbol not found: _PyBuffer_Type
  Referenced from: /usr/local/lib/python2.7/site-packages/numpy/core/multiarray.so
  Expected in: flat namespace
 in /usr/local/lib/python2.7/site-packages/numpy/core/multiarray.so

Well after digging around and trying to solve this issue most of last night I could not come up with much. 昨晚大部分时间,我一直在努力研究解决这个问题,但是我还是没想到。 I must have done something to my environment (I had done some builds of a couple of libraries from source)...anyway worst StackOverflow answer of all time, I used my TimeMachine to reset my mac back a week and the issue is gone. 我一定对我的环境做了一些事情(我已经从源代码上做了一些库的构建)...无论如何,这是有史以来最糟糕的StackOverflow答案,我用TimeMachine将我的Mac重置了一周,但问题消失了。 I guess the lesson is even if you are using environments in anaconda backups still cannot be beat. 我想这个教训是,即使您在anaconda备份中使用环境仍然无法胜任。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM