문제

After installing anaconda on my windows 7 machine I tried to install tradingwithpython package using the following methods.

pip install tradingwithpython

This was successfull but when I tried import from ipython I got the following error:

#==================================================
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

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

So after this I tried to create a recipe

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

then build this package and it gave me this error:

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

Any idea why this is not working?

Thanks.

도움이 되었습니까?

해결책

ImportError: No module named scipy

It could be that your Anaconda install is not complete. Scipy is a standard module and should be importable after Anaconda install.

Your problem seems to be a rare one, I've not heard of issues instaling twp under Win 7 and Anaconda.

I suggest that you reinstall your anaconda and try again.

다른 팁

write this command in notebook, not in terminal

!pip install tradingWithPython

then it will choice required anaconda environment automatically

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top