环境说明:
python-3.7.2-install
pycharm-community-2018.3.4
scipy-1.2.0-cp37-cp37m-win32.whl
numpy-1.16.1+mkl-cp37-cp37m-win32.whl
在安装bolozna-multilayer-networks-library包pymnet时会出现下面几个常见的问题,具体的解决办法如下:
问题1:
报错:ModuleNotFoundError: No module named scipy
说明系统环境缺少scipy库,需要自行安装,这里需要pip安装
打开cmd 窗口,进入pip可执行文件所在目录,
输入pip install scipy,安装完成即可输入。
问题2:
在第一步安装过程中弹出如下错误:
Python报错: Command “python setup.py egg_info” failed with error code 1
you are using pip version 18.1 ,howerver version 19.0.1 is avaliable.
you should consider upgrading via the python -m pip install --upgrade pip command
说明需要先更新一下pip版本,打开cmd 窗口
python -m pip install --upgrade pip
问题3:
更新完pip后,再执行pip install scipy,又弹出下面错误
File "D:Python34/lib/site-packages/setuptools/command/easy_install.py", line 1066, in build_and_install self.run_setup(setup_script, setup_base, args)
File "D:Python34/lib/site-packages/setuptools/command/easy_install.py", line 1054, in run_setup
raise DistutilsError("Setup script exited with %s" % (v.args[0],))
distutils.errors.DistutilsError: Setup script exited with error: Microsoft Visual C++ 14.0 is required .Get int with Microsoft Visual C++ Build Tools:
https://visualstudio.microsoft.com/downloads/
Command “python setup.py egg_info” failed with error code 1 in c:/users/admin~1/local/temp/pip-install-97_1wk_h/scipy
解决:
python 3.6安装numpy报错 error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++",
通过提示我们可以得知是由于c++依赖库不存在,所以在对包进行编译的时候出错,故我们可以去直接下载二进制安装包进行安装。
下载地址:
https://www.lfd.uci.edu/~gohlke/pythonlibs/
SciPy is software for mathematics, science, and engineering. Install numpy+mkl before installing scipy. NumPy, a fundamental package needed for scientific computing with Python. Numpy+MKL is linked to the Intel? Math Kernel Library and includes required DLLs in the numpy.core directory.
故先安装Numpy+MKL,然后安装scipy。
pip install c: umpy-1.16.1+mkl-cp37-cp37m-win32.whl
pip install c:scipy-1.2.0-cp37-cp37m-win32.whl
问题4:
在第三步安装scipy 时又出现如下错误:
~whl is not a supported wheel on this platform
解决办法:统一版本,下载的包和平台版本要统一,下载地址如下:
https://www.lfd.uci.edu/~gohlke/pythonlibs/#numpy
下载这两个包,同时降低Python的版本选3.7.2-win32
numpy-1.16.1+mkl-cp37-cp37m-win32.whl
scipy-1.2.0-cp37-cp37m-win32.whl
问题5:运行程序 出现如下
Python库导入错误:ImportError: No module named matplotlib
打开命令提示符,输入以下指令即可安装matplotlib模块:
python -m pip install matplotlib
Python中其他模块在Windows下安装指令与此类似。
问题6:
可以选择升级 setuptools
pip install --upgrade setuptools