Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/279.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/google-apps-script/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python Mac-没有名为'的模块;scipy&x27;_Python_Scipy_Pip_Homebrew - Fatal编程技术网

Python Mac-没有名为'的模块;scipy&x27;

Python Mac-没有名为'的模块;scipy&x27;,python,scipy,pip,homebrew,Python,Scipy,Pip,Homebrew,我什么都试过了,但还是没法去工作 通过自制程序安装的Scipy似乎工作正常,但在尝试导入时出现了错误。 已卸载,通过pip3安装,无差异。 Brew篡改,Brew链接(Scipy和python的未链接小桶强制链接),无进展 在macOS Mojave上运行(10.14.6)。 Numpy、matplotlib和更多功能工作正常。我错过了什么 我安装了两个版本的python,但是Scipy应该安装在python3.7中(我正在使用它)。详见下文: d37072:~ au341374$ brew i

我什么都试过了,但还是没法去工作

通过自制程序安装的Scipy似乎工作正常,但在尝试导入时出现了错误。 已卸载,通过pip3安装,无差异。 Brew篡改,Brew链接(Scipy和python的未链接小桶强制链接),无进展

在macOS Mojave上运行(10.14.6)。 Numpy、matplotlib和更多功能工作正常。我错过了什么

我安装了两个版本的python,但是Scipy应该安装在python3.7中(我正在使用它)。详见下文:

d37072:~ au341374$ brew info scipy
scipy: stable 1.3.0 (bottled), HEAD
Software for mathematics, science, and engineering
https://www.scipy.org
/usr/local/Cellar/scipy/1.3.0_1 (962 files, 47.3MB) *
  Poured from bottle on 2019-09-20 at 03:39:57
From: https://github.com/Homebrew/homebrew-core/blob/master/Formula/scipy.rb
==> Dependencies
Build: swig ✔
Required: gcc ✔, numpy ✔, openblas ✔, python ✔
==> Options
--HEAD
    Install HEAD version
'import sitecustomize' failed; use -v for traceback
'import sitecustomize' failed; use -v for traceback
==> Caveats
If you use system python (that comes - depending on the OS X version -
with older versions of numpy, scipy and matplotlib), you may need to
ensure that the brewed packages come earlier in Python's sys.path with:
  mkdir -p /Users/au341374/Library/Python/2.7/lib/python/site-packages
  echo 'import sys; sys.path.insert(1, "/usr/local/lib/python3.7/site-packages")' >> /Users/au341374/Library/Python/2.7/lib/python/site-packages/homebrew.pth
==> Analytics
install: 3,010 (30 days), 5,751 (90 days), 31,101 (365 days)
install_on_request: 2,070 (30 days), 3,613 (90 days), 19,312 (365 days)
build_error: 0 (30 days)
-

-

-

-

-


好吧,不知怎的,不经意间把它修好了。 我卸载并重新安装了numpy和scipy几次都没有用。 最后卸载了numpy、scipy、matplotlib、ipython和jupyter,这样我就可以卸载python了。重新安装pythonnumpy和scipy没有修复任何问题。 然后跑完

pip3 install --user numpy scipy matplotlib ipython jupyter pandas sympy nose
我想是这样的。 Scipy和numpy现在显然安装在

scipy in ./Library/Python/3.7/lib/python/site-packages (1.3.1)
numpy>=1.13.3 in ./Library/Python/3.7/lib/python/site-packages (from scipy) (1.17.2)
而不是在usr/local/lib/Python3.7/site-packages中,常规的“pip3安装scipy”正在安装它

现在唯一奇怪的是./Library/Python/实际上只包含一个名为2.7而不是3.7的文件夹(没有隐藏文件夹)。
我很奇怪,但是,嘿,它起作用了。

尝试导入scipy时有什么错误?简单地说:ModuleNotFoundError:没有名为“scipy”的模块
d37072:~ au341374$ brew doctor
Please note that these warnings are just used to help the Homebrew maintainers
with debugging if you file an issue. If everything you use Homebrew for is
working fine: please don't worry or file an issue; just ignore this. Thanks!

Warning: "config" scripts exist outside your system or Homebrew directories.
`./configure` scripts often look for *-config scripts to determine if
software packages are installed, and which additional flags to use when
compiling and linking.

Having additional scripts in your path can confuse software installed via
Homebrew if the config script overrides a system or Homebrew-provided
script of the same name. We found the following "config" scripts:
  /Library/Frameworks/Python.framework/Versions/3.7/bin/python3.7-config
  /Library/Frameworks/Python.framework/Versions/3.7/bin/python3.7m-config
  /Library/Frameworks/Python.framework/Versions/3.7/bin/python3-config
  /usr/local/munki/munkiwebadmin-config
d37072:~ au341374$ which -a python
/usr/local/bin/python
/usr/bin/python

d37072:~ au341374$ which -a pip
/usr/local/bin/pip

d37072:~ au341374$ which -a python3
/Library/Frameworks/Python.framework/Versions/3.7/bin/python3
/usr/local/bin/python3

d37072:~ au341374$ which -a pip3
/usr/local/bin/pip3
d37072:~ au341374$ pip -V
'import sitecustomize' failed; use -v for traceback
pip 19.1.1 from /usr/local/lib/python3.7/site-packages/pip (python 2.7)

d37072:~ au341374$ pip3 -V
pip 19.1.1 from /usr/local/lib/python3.7/site-packages/pip (python 3.7)
pip3 install --user numpy scipy matplotlib ipython jupyter pandas sympy nose
scipy in ./Library/Python/3.7/lib/python/site-packages (1.3.1)
numpy>=1.13.3 in ./Library/Python/3.7/lib/python/site-packages (from scipy) (1.17.2)