Ничего в PYTHONPATH
.
Результаты ниже ( tl; dr ) предполагают, что usr
и usr_sp
найдены, а mingw64
и mingw64_sp
нет.
ТЛ; др
[~]$ unset PYTHONPATH
[~]$ python3
Python 3.7.2 (default, Dec 26 2018, 08:23:20)
[GCC 7.4.0] on msys
Type "help", "copyright", "credits" or "license" for more information.
Reading /home/user1/.pythonrc
readline is in /usr/lib/python3.7/lib-dynload/readline.cpython-37m.dll
>>> import sys
>>> sys.path
['', '/usr/lib/python37.zip', '/usr/lib/python3.7', '/usr/lib/python3.7/lib-dynload', '/usr/lib/python3.7/site-packages']
>>> import datetime
>>> import json
>>> import msilib
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'msilib'
>>> import cairo
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'cairo'
>>> import colorama
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'colorama'
>>> import pip
>>> import pytest
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'pytest'
>>> import magic
>>> exit()
PYTHONPATH
с добавленной парой mingw64
.
Результаты ниже ( tl; dr ) показывают, что обе пары (usr
, usr_sp
) и (mingw64
, mingw64_sp
) найдены.
Но что-то все еще не хватает только для некоторых пакетов (в данном случае msilib
, cairo
, numpy
), в то время как для других конфигурации достаточно (в данном случае colorama
) ,
Кроме того, теперь что-то из mingw64
тени usr
(см. import magic
).
TLD; др
[~]$ env | grep -i python
PYTHONSTARTUP=/home/user1/.pythonrc
PYTHONPATH=/c/Users/user1/Documents/appls_mydocs/PortableApps/MSYS2Portable/App/msys32/mingw64/lib/python3.7:/c/Users/user1/Documents/appls_mydocs/PortableApps/MSYS2Portable/App/msys32/mingw64/lib/python3.7/site-packages
[~]$ python3
Python 3.7.2 (default, Dec 26 2018, 08:23:20)
[GCC 7.4.0] on msys
Type "help", "copyright", "credits" or "license" for more information.
Reading /home/user1/.pythonrc
readline is in /usr/lib/python3.7/lib-dynload/readline.cpython-37m.dll
>>> import sys
>>> sys.path
['', '/c/Users/ry16205/Documents/appls_mydocs/PortableApps/MSYS2Portable/App/msys32/mingw64/lib/python3.7', '/c/Users/ry16205/Documents/appls_mydocs/PortableApps/MSYS2Portable/App/msys32/mingw64/lib/python3.7/site-packages', '/usr/lib/python37.zip', '/usr/lib/python3.7', '/usr/lib/python3.7/lib-dynload', '/usr/lib/python3.7/site-packages']
>>> import datetime
>>> import json
>>> import msilib
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/c/Users/ry16205/Documents/appls_mydocs/PortableApps/MSYS2Portable/App/msys32/mingw64/lib/python3.7/msilib/__init__.py", line 3, in <module>
from _msi import *
ModuleNotFoundError: No module named '_msi'
>>> import cairo
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/c/Users/ry16205/Documents/appls_mydocs/PortableApps/MSYS2Portable/App/msys32/mingw64/lib/python3.7/site-packages/cairo/__init__.py", line 1, in <module>
from ._cairo import * # noqa: F401,F403
ModuleNotFoundError: No module named 'cairo._cairo'
>>> import colorama
>>> import numpy <----------------------- This sparked the question
Traceback (most recent call last):
File "/c/Users/ry16205/Documents/appls_mydocs/PortableApps/MSYS2Portable/App/msys32/mingw64/lib/python3.7/site-packages/numpy/core/__init__.py", line 40, in <module>
from . import multiarray
File "/c/Users/ry16205/Documents/appls_mydocs/PortableApps/MSYS2Portable/App/msys32/mingw64/lib/python3.7/site-packages/numpy/core/multiarray.py", line 12, in <module>
from . import overrides
File "/c/Users/ry16205/Documents/appls_mydocs/PortableApps/MSYS2Portable/App/msys32/mingw64/lib/python3.7/site-packages/numpy/core/overrides.py", line 6, in <module>
from numpy.core._multiarray_umath import (
ModuleNotFoundError: No module named 'numpy.core._multiarray_umath'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/c/Users/ry16205/Documents/appls_mydocs/PortableApps/MSYS2Portable/App/msys32/mingw64/lib/python3.7/site-packages/numpy/__init__.py", line 142, in <module>
from . import core
File "/c/Users/ry16205/Documents/appls_mydocs/PortableApps/MSYS2Portable/App/msys32/mingw64/lib/python3.7/site-packages/numpy/core/__init__.py", line 71, in <module>
raise ImportError(msg)
ImportError:
IMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE!
Importing the multiarray numpy extension module failed. Most
likely you are trying to import a failed build of numpy.
Here is how to proceed:
- If you're working with a numpy git repository, try `git clean -xdf`
(removes all files not under version control) and rebuild numpy.
- If you are simply trying to use the numpy version that you have installed:
your installation is broken - please reinstall numpy.
- If you have already reinstalled and that did not fix the problem, then:
1. Check that you are using the Python you expect (you're using /usr/bin/python3),
and that you have no directories in your PATH or PYTHONPATH that can
interfere with the Python and numpy versions you're trying to use.
2. If (1) looks fine, you can open a new issue at
https://github.com/numpy/numpy/issues. Please include details on:
- how you installed Python
- how you installed numpy
- your operating system
- whether or not you have multiple versions of Python installed
- if you built from source, your compiler versions and ideally a build log
Note: this error has many possible causes, so please don't comment on
an existing issue about this - open a new one instead.
Original error was: No module named 'numpy.core._multiarray_umath'
>>> import pip
>>> import pytest
>>> import magic
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python3.7/site-packages/magic.py", line 61, in <module>
_open = _libraries['magic'].magic_open
File "/c/Users/ry16205/Documents/appls_mydocs/PortableApps/MSYS2Portable/App/msys32/mingw64/lib/python3.7/ctypes/__init__.py", line 369, in __getattr__
func = self.__getitem__(name)
File "/c/Users/ry16205/Documents/appls_mydocs/PortableApps/MSYS2Portable/App/msys32/mingw64/lib/python3.7/ctypes/__init__.py", line 374, in __getitem__
func = self._FuncPtr((name_or_ordinal, self))
AttributeError: function 'magic_open' not found