Anaconda conda 安装 tradingwithpython 包时出错
在我的Windows 7电脑上安装了Anaconda之后,我尝试用以下方法安装tradingwithpython这个包。
我输入了命令:pip install tradingwithpython
这个安装成功了,但当我在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
把这个命令写在笔记本里,不要在终端里写。
!pip install tradingWithPython
这样它会自动选择所需的Anaconda环境。
0
错误提示:没有名为 scipy 的模块
这可能是因为你的 Anaconda 安装不完整。Scipy 是一个标准模块,安装完 Anaconda 后应该可以正常使用。
你的问题看起来比较少见,我没听说过在 Windows 7 和 Anaconda 下安装 twp 会出现这种问题。
我建议你重新安装 Anaconda,然后再试一次。