I have installed ActivePython 2.7 on Mac OS X 10.5. The main reason for this is to use pypm, the package manager. However, after installing ActivePython and setting up my .bash_profile file to use that version of Python, I encounter a lot of problems with the pypm-installed libraries. To install all of these modules, I just type
pypm install <package-name>
and this is how I got matplotlib, PyQt4, PIL, etc. The problem is that all of these appear to install with no problems, they place the correct .pth and .so files into the correct site-packages folder, and basic imports work fine. But I get the following errors.
First, here is what I see when checking for Python on my machine:
new-host:site-packages ely$ which python
/usr/local/bin/python
new-host:site-packages ely$ ls -l /usr/local/bin/python
lrwxr-xr-x 1 root wheel 60 May 25 22:15 /usr/local/bin/python -> /Library/Frameworks/Python.framework/Versions/2.7/bin/python
Next, I invoke Python and attempt to import things.
new-host:site-packages ely$ python
ActivePython 2.7.1.4 (ActiveState Software Inc.) based on
Python 2.7.1 (r271:86832, Feb 7 2011, 11:33:10)
[GCC 4.2.1 (Apple Inc. build 5664)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import PyQt4
>>> from PyQt4 import QtGui
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: dlopen(PyQt4/QtGui.so, 2): Library not loaded: QtGui.framework/Versions/4/QtGui
Referenced from: /Users/ely/Library/Python/2.7/lib/python/site-packages/PyQt4/QtGui.so
Reason: image not found
So the above shows that PyQt4 imports with no complaints, but then I get the 'image not found' error when I try to use any of the sub-modules. For another example, here is the standard matplotlib.
>>> import matplotlib
>>> import matplotlib.pyplot as plt
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "matplotlib/pyplot.py", line 23, in <module>
from matplotlib.figure import Figure, figaspect
File "matplotlib/figure.py", line 16, in <module>
import artist
File "matplotlib/artist.py", line 6, in <module>
from transforms import Bbox, IdentityTransform, TransformedBbox, TransformedPath
File "matplotlib/transforms.py", line 34, in <module>
from matplotlib._path import affine_transform
ImportError: dlopen(matplotlib/_path.so, 2): Symbol not found: __ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
Referenced from: /Users/ely/Library/Python/2.7/lib/python/site-packages/matplotlib/_path.so
Expected in: dynamic lookup
>>> from matplotlib import pyplot
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "matplotlib/pyplot.py", line 23, in <module>
from matplotlib.figure import Figure, figaspect
File "matplotlib/figure.py", line 16, in <module>
import artist
File "matplotlib/artist.py", line 6, in <module>
from transforms import Bbox, IdentityTransform, TransformedBbox, TransformedPath
File "matplotlib/transforms.py", line 34, in <module>
from matplotlib._path import affine_transform
ImportError: dlopen(matplotlib/_path.so, 2): Symbol not found: __ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
Referenced from: /Users/ely/Library/Python/2.7/lib/python/site-packages/matplotlib/_path.so
Expected in: dynamic lookup
Any thoughts on why the pypm-installed versions are so problematic? I've used ActivePython and pypm on my Ubuntu work computer for a long time and never had any of these issues. Everything I've ever installed with pypm has worked beautifully. Why is it so different on Mac?
Make sure python and qt have same architecture (32bit vs 64bit)
for mathplot looks like a different g++ used to compile python and mathplot
have you tried with stock osx python?
Related
Motivation: The package of interest only works with GCC compiled Python, and I would like to use an IDE (Spyder) to interpret the GCC compiled Python which is not the default MSC version of Python included with Anaconda 3 on windows.
Issue: DLL load failed while importing [package name]: The specified procedure could not be found.
System information:
Windows 10 Home Build 19043.1526 with WSL Enabled.
Bash: MSYS2 MinGW x64
Spyder 5.1.5
gcc version 11.2.0 targeting x86_64-w64-ming32
Python 3.9.10 (main, Jan 25 2022, 17:58:23) [GCC 11.2.0 64 bit (AMD64)]
Reproducible Example:
Download Anaconda 3 which includes Spyder and default MSC compiled
Python
Use Msys2 64 bit with Mingw64 to obtain GCC compiled python. To do
so, you would need to use pacman to obtain mingw-w64-x86_64-toolchain
and python for mingw64.
Install common python packages such as numpy, scipy, and matplotlib
using pacman. You will also need spyder dependencies such as
spyder-kernels and IPython. If the dependencies are not satisfied, Spyder will fail to start the kernel.
At this stage, running python in mingw64 (by typing "python" in
bash) should have no problems. Importing packages should also have
no problems. e.g, import matplotlib.pyplot
Try using Anaconda 3 Spyder to interpret the GCC python by going to:
Tool > Preferences > Python interpreter > Select Use the following
python interpreter > Set the location to
"path to
msys2"\mingw64\bin\python.exe
Depending on the matplotlib graphical settings, you may or may not
already receive an error in the console regarding a DLL load
failure. If not, then importing matplotlib.pyplot or importing
scipy.optimize, should give you the error. However, starting GCC
python in mingw64 will have no problem importing these packages.
Errors:
Python 3.9.10 (main, Jan 25 2022, 17:58:23) [GCC 11.2.0 64 bit (AMD64)]
Type "copyright", "credits" or "license" for more information.
IPython -- An enhanced Interactive Python.
Output from spyder call 'show_mpl_backend_errors':
=========================================================================
NOTE: The following error appeared when setting your Matplotlib backend!!
=========================================================================
Traceback (most recent call last):
File "C:\msys64\mingw64\lib\python3.9\site-packages\spyder_kernels\console\kernel.py", line 739, in _set_mpl_backend
get_ipython().run_line_magic(magic, backend)
File "C:\msys64\mingw64\lib\python3.9\site-packages\IPython\core\interactiveshell.py", line 2364, in run_line_magic
result = fn(*args, **kwargs)
File "C:\msys64\mingw64\lib\python3.9\site-packages\decorator.py", line 232, in fun
return caller(func, *(extras + args), **kw)
File "C:\msys64\mingw64\lib\python3.9\site-packages\IPython\core\magic.py", line 187, in <lambda>
call = lambda f, *a, **k: f(*a, **k)
File "C:\msys64\mingw64\lib\python3.9\site-packages\IPython\core\magics\pylab.py", line 99, in matplotlib
gui, backend = self.shell.enable_matplotlib(args.gui.lower() if isinstance(args.gui, str) else args.gui)
File "C:\msys64\mingw64\lib\python3.9\site-packages\ipykernel\zmqshell.py", line 601, in enable_matplotlib
gui, backend = super(ZMQInteractiveShell, self).enable_matplotlib(gui)
File "C:\msys64\mingw64\lib\python3.9\site-packages\IPython\core\interactiveshell.py", line 3533, in enable_matplotlib
from matplotlib_inline.backend_inline import configure_inline_support
File "C:\msys64\mingw64\lib\python3.9\site-packages\matplotlib_inline\backend_inline.py", line 7, in <module>
from matplotlib.backends.backend_agg import ( # noqa
File "C:\msys64\mingw64\lib\python3.9\site-packages\matplotlib\backends\backend_agg.py", line 35, in <module>
from PIL import Image
File "C:\msys64\mingw64\lib\python3.9\site-packages\PIL\Image.py", line 89, in <module>
from . import _imaging as core
ImportError: DLL load failed while importing _imaging: The specified procedure could not be found.
import matplotlib.pyplot
Traceback (most recent call last):
File "<ipython-input-1-864e826dab68>", line 1, in <module>
import matplotlib.pyplot
File "C:\msys64\mingw64\lib\python3.9\site-packages\matplotlib\pyplot.py", line 36, in <module>
import matplotlib.colorbar
File "C:\msys64\mingw64\lib\python3.9\site-packages\matplotlib\colorbar.py", line 44, in <module>
import matplotlib.contour as contour
File "C:\msys64\mingw64\lib\python3.9\site-packages\matplotlib\contour.py", line 17, in <module>
import matplotlib.text as text
File "C:\msys64\mingw64\lib\python3.9\site-packages\matplotlib\text.py", line 16, in <module>
from .textpath import TextPath # Unused, but imported by others.
File "C:\msys64\mingw64\lib\python3.9\site-packages\matplotlib\textpath.py", line 11, in <module>
from matplotlib.mathtext import MathTextParser
File "C:\msys64\mingw64\lib\python3.9\site-packages\matplotlib\mathtext.py", line 27, in <module>
from PIL import Image
File "C:\msys64\mingw64\lib\python3.9\site-packages\PIL\Image.py", line 89, in <module>
from . import _imaging as core
ImportError: DLL load failed while importing _imaging: The specified procedure could not be found.
import scipy.optimize
Traceback (most recent call last):
File "<ipython-input-2-77fb0d19797b>", line 1, in <module>
import scipy.optimize
File "C:\msys64\mingw64\lib\python3.9\site-packages\scipy\optimize\__init__.py", line 413, in <module>
from ._linprog import linprog, linprog_verbose_callback
File "C:\msys64\mingw64\lib\python3.9\site-packages\scipy\optimize\_linprog.py", line 22, in <module>
from ._linprog_highs import _linprog_highs
File "C:\msys64\mingw64\lib\python3.9\site-packages\scipy\optimize\_linprog_highs.py", line 20, in <module>
from ._highs._highs_wrapper import _highs_wrapper
ImportError: DLL load failed while importing _highs_wrapper: The specified procedure could not be found.
I am completely new to Python but I enjoyed it very much. I start with Python 2.7 before migrating to Python 3 since many applications for work have to do with Python 2.7.
I have quite sadly many version of python2.7 on my MacBook. One from Apple, one from Homebrew, one from Anaconda. I have pip version 18.0 installed.
I wanted to install many modules (scipy in particular) and I ran into the following problem.
On the console:
Python 2.7.15 (v2.7.15:ca079a3ea3, Apr 29 2018, 20:59:26)
[GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.57)] on darwin
Type "copyright", "credits" or "license()" for more information.
>>> import matplotlib
I get the error message:
Traceback (most recent call last):
File "", line 1, in
import matplotlib
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib/init.py", line 130, in
from matplotlib.rcsetup import defaultParams, validate_backend, cycler
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib/rcsetup.py", line 29, in
from matplotlib.fontconfig_pattern import parse_fontconfig_pattern
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib/fontconfig_pattern.py", line 28, in
from backports.functools_lru_cache import lru_cache
ImportError: No module named functools_lru_cache
I looked on the web and found the solution for that by typing:
pip install --user matplotlib
Now when I do:
>>> import matplotlib
I get the message:
Traceback (most recent call last):
File "", line 1, in
import matplotlib
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib/init.py", line 126, in
from . import cbook
ImportError: cannot import name cbook
There is a confusion on the web about how to solve this problem. Is there still hope I can get back running?
I'm using python 3.5.2 (64 bit) within a operating system Linux Mint 18 with a kernel release 4.4.0-109-generic.
A long time ago I installed PyQt4 through sudo apt-get install python3-pyqt4 and everything worked perfectly, untill I recently installed through pip PyQt5.
Since then, I'm able to import PyQt4 and import PyQt4.pyqtconfig but not the modules like import PyQt4.QtCore, import PyQt4.QtGui or import PyQt4.Qt for which exits python with 'Segmentation Fault'. I've also realized that the command (within python enviroment) help('modules') gives same output after some seconds.
I've tried to remove PyQt5 with pip and reinstall PyQt4 from terminal (version 4.11.4+dfsg-1build4), but nothing seems to change. I also can see the directory from the PyQt4 from /usr/lib/python3/dist-packages/PyQt4
I've also tried to create a python virtual environment with virtualenv env --python=python3.5 inside a folder and copy the whole directory from PyQt4 to the dist-packages of the environment and also install sip within it. Using sip 4.19.8 version from pip.
Another thing I've tried is to use gdb python3 to run a python program that only contains the code:
#!/usr/bin/python3
import PyQt4.QtCore
What it returns is this:
$ gdb -q python3
Reading symbols from python3...Reading symbols from /usr/lib/debug/.build-id/59/a8ef36ca241df24686952480966d7bc0d7c6ea.debug...done.
done.
(gdb) run FaultPy35.py
Starting program: /usr/bin/python3 FaultPy35.py
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Program received signal SIGSEGV, Segmentation fault.
PyType_IsSubtype () at ../Objects/typeobject.c:1343
1343 ../Objects/typeobject.c: No such file or directory.
(gdb) c
Continuing.
Program terminated with signal SIGSEGV, Segmentation fault.
The program no longer exists.
(gdb)
I'm really new to gdb but apparently the problem goes beyond python packages...
Note: I've checked via dpkg-query -L python3-pyqt4 what the package python3-pyqt4 has installed in the following list:
/.
/usr
/usr/share
/usr/share/doc
/usr/share/doc/python3-pyqt4
/usr/share/doc/python3-pyqt4/THANKS
/usr/share/doc/python3-pyqt4/copyright
/usr/share/doc/python3-pyqt4/changelog.Debian.gz
/usr/lib
/usr/lib/python3
/usr/lib/python3/dist-packages
/usr/lib/python3/dist-packages/PyQt4
/usr/lib/python3/dist-packages/PyQt4/QtHelp.cpython-35m-x86_64-linux-gnu.so
/usr/lib/python3/dist-packages/PyQt4/uic
/usr/lib/python3/dist-packages/PyQt4/uic/Compiler
/usr/lib/python3/dist-packages/PyQt4/uic/Compiler/qtproxies.py
/usr/lib/python3/dist-packages/PyQt4/uic/Compiler/proxy_metaclass.py
/usr/lib/python3/dist-packages/PyQt4/uic/Compiler/compiler.py
/usr/lib/python3/dist-packages/PyQt4/uic/Compiler/indenter.py
/usr/lib/python3/dist-packages/PyQt4/uic/Compiler/misc.py
/usr/lib/python3/dist-packages/PyQt4/uic/Compiler/qobjectcreator.py
/usr/lib/python3/dist-packages/PyQt4/uic/Compiler/__init__.py
/usr/lib/python3/dist-packages/PyQt4/uic/objcreator.py
/usr/lib/python3/dist-packages/PyQt4/uic/Loader
/usr/lib/python3/dist-packages/PyQt4/uic/Loader/loader.py
/usr/lib/python3/dist-packages/PyQt4/uic/Loader/qobjectcreator.py
/usr/lib/python3/dist-packages/PyQt4/uic/Loader/__init__.py
/usr/lib/python3/dist-packages/PyQt4/uic/driver.py
/usr/lib/python3/dist-packages/PyQt4/uic/properties.py
/usr/lib/python3/dist-packages/PyQt4/uic/uiparser.py
/usr/lib/python3/dist-packages/PyQt4/uic/pyuic.py
/usr/lib/python3/dist-packages/PyQt4/uic/port_v3
/usr/lib/python3/dist-packages/PyQt4/uic/port_v3/invoke.py
/usr/lib/python3/dist-packages/PyQt4/uic/port_v3/ascii_upper.py
/usr/lib/python3/dist-packages/PyQt4/uic/port_v3/proxy_base.py
/usr/lib/python3/dist-packages/PyQt4/uic/port_v3/load_plugin.py
/usr/lib/python3/dist-packages/PyQt4/uic/port_v3/as_string.py
/usr/lib/python3/dist-packages/PyQt4/uic/port_v3/string_io.py
/usr/lib/python3/dist-packages/PyQt4/uic/port_v3/__init__.py
/usr/lib/python3/dist-packages/PyQt4/uic/__init__.py
/usr/lib/python3/dist-packages/PyQt4/uic/widget-plugins
/usr/lib/python3/dist-packages/PyQt4/uic/widget-plugins/phonon.py
/usr/lib/python3/dist-packages/PyQt4/uic/widget-plugins/qtwebkit.py
/usr/lib/python3/dist-packages/PyQt4/uic/widget-plugins/qtdeclarative.py
/usr/lib/python3/dist-packages/PyQt4/uic/widget-plugins/.noinit
/usr/lib/python3/dist-packages/PyQt4/uic/widget-plugins/qaxcontainer.py
/usr/lib/python3/dist-packages/PyQt4/uic/widget-plugins/qscintilla.py
/usr/lib/python3/dist-packages/PyQt4/uic/icon_cache.py
/usr/lib/python3/dist-packages/PyQt4/uic/exceptions.py
/usr/lib/python3/dist-packages/PyQt4/QtSvg.cpython-35m-x86_64-linux-gnu.so
/usr/lib/python3/dist-packages/PyQt4/Qt.cpython-35m-x86_64-linux-gnu.so
/usr/lib/python3/dist-packages/PyQt4/pyqtconfig.py
/usr/lib/python3/dist-packages/PyQt4/QtScriptTools.cpython-35m-x86_64-linux-gnu.so
/usr/lib/python3/dist-packages/PyQt4/pyqtconfig_nd5.py
/usr/lib/python3/dist-packages/PyQt4/QtDesigner.cpython-35m-x86_64-linux-gnu.so
/usr/lib/python3/dist-packages/PyQt4/QtCore.cpython-35m-x86_64-linux-gnu.so
/usr/lib/python3/dist-packages/PyQt4/QtDeclarative.cpython-35m-x86_64-linux-gnu.so
/usr/lib/python3/dist-packages/PyQt4/QtGui.cpython-35m-x86_64-linux-gnu.so
/usr/lib/python3/dist-packages/PyQt4/QtNetwork.cpython-35m-x86_64-linux-gnu.so
/usr/lib/python3/dist-packages/PyQt4/QtXml.cpython-35m-x86_64-linux-gnu.so
/usr/lib/python3/dist-packages/PyQt4/QtWebKit.cpython-35m-x86_64-linux-gnu.so
/usr/lib/python3/dist-packages/PyQt4/QtDBus.cpython-35m-x86_64-linux-gnu.so
/usr/lib/python3/dist-packages/PyQt4/QtAssistant.cpython-35m-x86_64-linux-gnu.so
/usr/lib/python3/dist-packages/PyQt4/__init__.py
/usr/lib/python3/dist-packages/PyQt4/QtXmlPatterns.cpython-35m-x86_64-linux-gnu.so
/usr/lib/python3/dist-packages/PyQt4/QtTest.cpython-35m-x86_64-linux-gnu.so
/usr/lib/python3/dist-packages/PyQt4/QtScript.cpython-35m-x86_64-linux-gnu.so
Any Ideas?
Update (25/04/18)
I tried the python 3.5 debug build at import time:
$ python3-dbg
Python 3.5.2 (default, Nov 23 2017, 16:37:01)
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import PyQt4
>>> import PyQt4.QtCore
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named 'PyQt4.QtCore'
Error in sys.excepthook:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/apport_python_hook.py", line 63, in apport_excepthook
from apport.fileutils import likely_packaged, get_recent_crashes
File "/usr/lib/python3/dist-packages/apport/__init__.py", line 5, in <module>
from apport.report import Report
File "/usr/lib/python3/dist-packages/apport/report.py", line 30, in <module>
import apport.fileutils
File "/usr/lib/python3/dist-packages/apport/fileutils.py", line 23, in <module>
from apport.packaging_impl import impl as packaging
File "/usr/lib/python3/dist-packages/apport/packaging_impl.py", line 23, in <module>
import apt
File "/usr/lib/python3/dist-packages/apt/__init__.py", line 23, in <module>
import apt_pkg
ImportError: No module named 'apt_pkg'
Original exception was:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named 'PyQt4.QtCore'
>>>
I'm new to Python and Cloud9, so I am not sure if I have a python issue or a Cloud9 issue (or both or something completely different)
My basic problem is that within Python I can import some modules, but not others. I've installed the modules 'xport' & 'numpy' with pip, but only 'xport' is working.
If I try to 'import numpy' i get the following error:
Python 2.7.6 (default, Nov 23 2017, 15:49:48)
[GCC 4.8.4] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import xport
>>> import numpy
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python2.7/dist-packages/numpy/__init__.py", line 153, in <module>
from . import add_newdocs
File "/usr/lib/python2.7/dist-packages/numpy/add_newdocs.py", line 13, in <module>
from numpy.lib import add_newdoc
File "/usr/lib/python2.7/dist-packages/numpy/lib/__init__.py", line 18, in <module>
from .polynomial import *
File "/usr/lib/python2.7/dist-packages/numpy/lib/polynomial.py", line 19, in <module>
from numpy.linalg import eigvals, lstsq, inv
File "/usr/lib/python2.7/dist-packages/numpy/linalg/__init__.py", line 50, in <module>
from .linalg import *
File "/usr/lib/python2.7/dist-packages/numpy/linalg/linalg.py", line 29, in <module>
from numpy.linalg import lapack_lite, _umath_linalg
ImportError: liblapack.so.3: cannot open shared object file: No such file or directory
>>> exit()
I've tried 'pip install numpy --upgrade', but it didn't fix anything. Where should I go from here?
Here's a URL that should help get you started in Cloud9 - get-scipy-stack-for-aws-lambda.sh. The key is to install with yum.
I can then import numpy in the Python shell and a simple Python script, but I'm having a problem getting it to work in the Lambda function itself, and it's having the same issue, unable to find the liblapack.so.3. Still working on that part. I, too, am very new to Cloud9.
My Environment: Win10 64 bits, Python 3.6 and I use pip install to install NumPy instead of Anaconda. NumPy version: 1.13.0
I have seen several people posted similar questions, but most of them are using Python 2.7. The closest solution I have seen so far is: https://github.com/ContinuumIO/anaconda-issues/issues/1508 and https://github.com/numpy/numpy/issues/9272. But it seems they did not solve it in the end and the people who posted it are using Python 2.7. Therefore, I was wondering if someone can help me about this. My error log is below. Any help would be appreciated.
C:\Users\Kevin>python
Python 3.6.0 (v3.6.0:41df79263a11, Dec 23 2016, 07:18:10) [MSC v.1900 32 bit
(Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy
Traceback (most recent call last):
File "D:\Python3.6\lib\site-packages\numpy\core\__init__.py", line 16, in
<module>
from . import multiarray
ImportError: DLL load failed: The specified procedure could not be found.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "D:\Python3.6\lib\site-packages\numpy\__init__.py", line 142, in
<module>
from . import add_newdocs
File "D:\Python3.6\lib\site-packages\numpy\add_newdocs.py", line 13, in
<module>
from numpy.lib import add_newdoc
File "D:\Python3.6\lib\site-packages\numpy\lib\__init__.py", line 8, in
<module>
from .type_check import *
File "D:\Python3.6\lib\site-packages\numpy\lib\type_check.py", line 11, in
<module>
import numpy.core.numeric as _nx
File "D:\Python3.6\lib\site-packages\numpy\core\__init__.py", line 26, in
<module>
raise ImportError(msg)
ImportError:
Importing the multiarray numpy extension module failed. Most
likely you are trying to import a failed build of numpy.
If you're working with a numpy git repo, try `git clean -xdf` (removes all
files not under version control). Otherwise reinstall numpy.
Original error was: DLL load failed: The specified procedure could not be
found.
You should go with doing a clean install of numpy. Just don't go with the traditional way but download the wheel file instead. You can get the wheel file from here: http://www.lfd.uci.edu/~gohlke/pythonlibs/ . Download this file- numpy‑1.13.0+mkl‑cp36‑cp36m‑win_amd64.whl and install this wheel using pip. Check by importing numpy from shell.
If you do not want to bother with finding the wheel file just uninstall numpy and install an old version:
pip3 uninstall numpy
pip3 install 'numpy<1.13'
Uninstall NumPy and after that type:
pip3 install numpy==1.12