ipython安装成功后用不了,模块已成功安装,但在IPython中找不到

I have installed the package bigfloat and the MPFR and GMP libraries. When I run python in the terminal (I use a Mac), bigfloat can be imported and works successfully. However, I typically write my scripts in iPython Notebook. When I try to import bigfloat here, it says 'module not found.'

I have installed other packages such as SciPy, and using print scipy.file I see that it is located at //anaconda/lib/python2.7/site-packages/scipy/init.pyc

I'm not sure of how to check where bigfloat is located. From reading other peoples' installation issues, I am thinking that there might be more than one version of Python on my computer, and that is the problem? If this is the case, I'm not sure how to 1). Find the 'other' Python and delete it and 2). Make sure that future installations always install in the correct place (because I don't know where this is).

I've included my sys.path and error:

import sys

sys.path

['',

'//anaconda/python.app/Contents/lib/python27.zip',

'//anaconda/python.app/Contents/lib/python2.7',

'//anaconda/python.app/Contents/lib/python2.7/plat-darwin',

'//anaconda/python.app/Contents/lib/python2.7/plat-mac',

'//anaconda/python.app/Contents/lib/python2.7/plat-mac/lib-scriptpackages',

'//anaconda/python.app/Contents/lib/python2.7/lib-tk',

'//anaconda/python.app/Contents/lib/python2.7/lib-old',

'//anaconda/python.app/Contents/lib/python2.7/lib-dynload',

'//anaconda/lib/python2.7/site-packages',

'//anaconda/lib/python2.7/site-packages/PIL',

'//anaconda/lib/python2.7/site-packages/setuptools-0.6c11-py2.7.egg-info',

'//anaconda/lib/python2.7/site-packages/IPython/extensions']

import numpy as np

import scipy

from scipy.special import gamma, gammainc

import scipy.optimize as scopt

print scipy.__file__

import sympy

print sympy.__file__

import bigfloat

import sympy.mpmath as mpmath

from __future__ import division

ImportError Traceback (most recent call last)

in ()

6 import sympy

7 print sympy.file

----> 8 import bigfloat

9 import sympy.mpmath as mpmath

10 from future import division

ImportError: No module named bigfloat

//anaconda/lib/python2.7/site-packages/scipy/init.pyc

//anaconda/lib/python2.7/site-packages/sympy/init.pyc

解决方案

I figured it out, mainly from using this question/answer.

Basically, I added both my "anaconda paths" and my "python paths" to my sys.path, using:

sys.path =['', etc.].

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值