安装tradingwithpython包时Anaconda conda安装错误

时间:2014-05-01 22:48:38

标签: python pip anaconda conda

在我的Windows 7机器上安装anaconda之后,我尝试使用以下方法安装tradingwithpython包。

pip install tr​​adingwithpython

这是成功的但是当我尝试从ipython导入时出现以下错误:

#==================================================
Python 2.7.6 |Anaconda 1.9.2 (32-bit)| (default, Nov 11 2013, 10:50:31) [MSC v.1500 32 bit (Intel)]
Type "copyright", "credits" or "license" for more information.

IPython 1.1.0 -- An enhanced Interactive Python.
?         -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help      -> Python's own help system.
object?   -> Details about 'object', use 'object??' for extra details.

In [1]: import tradingwithpytohn
---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
<ipython-input-1-b118a20534e9> in <module>()
----> 1 import tradingwithpytohn

ImportError: No module named tradingwithpytohn

#==========================================================

所以在此之后我尝试创建一个食谱

C:\Users\dave\Anaconda>conda skeleton pypi tradingwithpython --no-download
tradingwithpython not found, trying Tradingwithpython
Using url https://pypi.python.org/packages/source/t/tradingWithPython/tradingWithPython-0.0.10.zip (20684) for tradingWithPython.
Using "BSD" for the license
Writing recipe for tradingwithpython
Done

然后构建这个包,它给了我这个错误:

C:\Users\dave\Anaconda>conda build tradingwithpython
C:\Users\dave\Anaconda\envs\_build\Lib\SITE-P~1\yaml.dll - Access is denied.
C:\Users\dave\Anaconda\envs\_build\Lib\SITE-P~1\_yaml.pyd - Access is denied.
Fetching package metadata: ...
Solving package specifications: .
The following packages will be linked:

    package                    |            build
    ---------------------------|-----------------
    python-2.7.6               |                0   hard-link

Linking packages ...
[      COMPLETE      ] |#################################################| 100%
BUILD START: tradingwithpython-0.0.10-py27_0
Source cache directory is: C:\Users\dave\Anaconda\conda-bld\src_cache
Found source in cache: tradingWithPython-0.0.10.zip
source tree in: C:\Users\dave\Anaconda\conda-bld\work\tradingWithPython-0.0.10

C:\Users\dave\Anaconda\conda-bld\work\tradingWithPython-0.0.10>call "C:\Program Files\Microsoft Visual Studio 9.0\VC\vcvarsall.ba
t" x86
Setting environment for using Microsoft Visual Studio 2008 x86 tools.

C:\Users\dave\Anaconda\conda-bld\work\tradingWithPython-0.0.10>set TMP=C:\Users\dave\AppData\Local\Temp
....
....
....
C:\Users\dave\Anaconda\conda-bld\work\tradingWithPython-0.0.10>"C:\Users\dave\Anaconda\envs\_build\python.exe" setup.py instal
l
Traceback (most recent call last):
  File "setup.py", line 3, in <module>
    import tradingWithPython as twp
  File "C:\Users\dave\Anaconda\conda-bld\work\tradingWithPython-0.0.10\tradingWithPython\__init__.py", line 5, in <module>
    from lib.functions import *
  File "C:\Users\dave\Anaconda\conda-bld\work\tradingWithPython-0.0.10\tradingWithPython\lib\functions.py", line 9, in <module>
    from scipy  import  polyfit, polyval
ImportError: No module named scipy

C:\Users\dave\Anaconda\conda-bld\work\tradingWithPython-0.0.10>if errorlevel 1 exit 1
Command failed: C:\Windows\system32\cmd.exe /c bld.bat

知道为什么这不起作用吗?

感谢。

2 个答案:

答案 0 :(得分:0)

ImportError:没有名为scipy的模块

可能是您的Anaconda安装不完整。 Scipy是一个标准模块,应该在Anaconda安装后可导入。

你的问题似乎很少见,我没有听说过在Win 7和Anaconda下安装twp的问题。

我建议您重新安装anaconda并重试。

答案 1 :(得分:0)

在笔记本中写入此命令,而不是在终端

!pip install tradingWithPython

然后它将自动选择所需的anaconda环境