GrahamDumpleton / wrapt

A Python module for decorators, wrappers and monkey patching.
BSD 2-Clause "Simplified" License
2.04k stars 230 forks source link

No module named 'wrapt' on python 3.8.5 #171

Closed Dom1st closed 3 years ago

Dom1st commented 3 years ago

Hi Graham, As you can see below, I have a basic installation issue that I can't seem to resolve. i installed the latest version of pip. What do you think is wrong? Cheers, Dominique

(base) C:\Users\Dominique>pip show pip Name: pip Version: 20.3.3 Summary: The PyPA recommended tool for installing Python packages. Home-page: https://pip.pypa.io/ Author: The pip developers Author-email: distutils-sig@python.org License: MIT Location: c:\users\dom\appdata\roaming\python\python38\site-packages

(base) C:\Users\Dominique>pip3 install wrapt Collecting wrapt Using cached wrapt-1.12.1-py3-none-any.whl Installing collected packages: wrapt Successfully installed wrapt-1.12.1

(base) C:\Users\Dominique>python Python 3.8.5 (default, Sep 3 2020, 21:29:08) [MSC v.1916 64 bit (AMD64)] :: Anaconda, Inc. on win32 Type "help", "copyright", "credits" or "license" for more information.

import wrapt Traceback (most recent call last): File "", line 1, in ModuleNotFoundError: No module named 'wrapt'

GrahamDumpleton commented 3 years ago

What do you get when you run:

which pip3
which python3

and:

pip3 freeze
Dom1st commented 3 years ago

Windows 10 (version 2004) 19041.746 Miniconda3 - Python 3.8.5 (default, Sep 3 2020, 21:29:08) [MSC v.1916 64 bit (AMD64)] :: Anaconda, Inc. on win32

(base) C:\Users\Dominique>where pip3 C:\ProgramData\Miniconda3\Scripts\pip3.exe

(base) C:\Users\Dominique>where python3 C:\Users\Dominique\AppData\Local\Microsoft\WindowsApps\python3.exe

(base) C:\Users\Dominique>pip3 freeze absl-py==0.11.0 astunparse==1.6.3 brotlipy==0.7.0 cachetools==4.2.0 certifi==2020.6.20 cffi @ file:///C:/ci/cffi_1605538112425/work chardet @ file:///C:/ci/chardet_1605303225733/work conda==4.9.2 conda-package-handling @ file:///C:/ci/conda-package-handling_1603003327818/work cryptography @ file:///C:/ci/cryptography_1605526388508/work flatbuffers==1.12 gast==0.3.3 google-auth==1.24.0 google-auth-oauthlib==0.4.2 google-pasta==0.2.0 grpcio==1.32.0 h5py==2.10.0 idna @ file:///tmp/build/80754af9/idna_1593446292537/work Keras-Preprocessing==1.1.2 Markdown==3.3.3 menuinst==1.4.16 monotonic==1.5 netifaces==0.10.9 numpy==1.19.5 oauthlib==3.1.0 opt-einsum==3.3.0 protobuf==3.14.0 pyasn1==0.4.8 pyasn1-modules==0.2.8 pycosat==0.6.3 pycparser @ file:///tmp/build/80754af9/pycparser_1594388511720/work pyOpenSSL @ file:///tmp/build/80754af9/pyopenssl_1605545627475/work PySocks @ file:///C:/ci/pysocks_1605287845585/work pywin32==227 requests @ file:///tmp/build/80754af9/requests_1592841827918/work requests-oauthlib==1.3.0 rsa==4.7 ruamel-yaml==0.15.87 scipy==1.4.1 six @ file:///C:/ci/six_1605187374963/work tensorboard==2.4.0 tensorboard-plugin-wit==1.7.0 tensorflow @ file:///C:/Users/Dominique/Downloads/tensorflow-2.4.0-cp38-cp38-win_amd64.whl tensorflow-estimator==2.4.0 termcolor==1.1.0 tqdm @ file:///tmp/build/80754af9/tqdm_1605303662894/work typing-extensions==3.7.4.3 urllib3 @ file:///tmp/build/80754af9/urllib3_1603305693037/work Werkzeug==1.0.1 win-inet-pton @ file:///C:/ci/win_inet_pton_1605306167264/work wincertstore==0.2 wrapt==1.12.1

Dom1st commented 3 years ago

To easily reproduce with Miniconda3-latest-Windows-x86_64.exe: conda create -n wrapt_test python=3.8 conda activate wrapt_test pip3 install wrapt python -c "import wrapt"

Dump: (base) C:\Users\Dominique>conda create -n wrapt_test python=3.8 Collecting package metadata (current_repodata.json): done Solving environment: done

(base) C:\Users\Dominique>conda activate wrapt_test

(wrapt_test) C:\Users\Dominique>pip3 install wrapt Collecting wrapt Using cached wrapt-1.12.1-py3-none-any.whl Installing collected packages: wrapt Successfully installed wrapt-1.12.1

(wrapt_test) C:\Users\Dominique>python Python 3.8.5 (default, Sep 3 2020, 21:29:08) [MSC v.1916 64 bit (AMD64)] :: Anaconda, Inc. on win32 Type "help", "copyright", "credits" or "license" for more information.

import wrapt Traceback (most recent call last): File "", line 1, in ModuleNotFoundError: No module named 'wrapt'

GrahamDumpleton commented 3 years ago

Try:

pip3 install -U --no-cache-dir wrapt

Your cached wheel could be broken.

Also instead try:

conda install wrapt
Dom1st commented 3 years ago

Thanks Graham, it works now!

(base) C:\Users\Dominique>activate akida_tf24_py38

(akida_tf24_py38) C:\Users\Dominique>pip list Package Version


certifi 2020.12.5 pip 20.3.3 setuptools 51.1.2.post20210112 wheel 0.36.2 wincertstore 0.2

(akida_tf24_py38) C:\Users\Dominique>pip3 install -U --no-cache-dir wrapt Collecting wrapt Downloading wrapt-1.12.1.tar.gz (27 kB) Building wheels for collected packages: wrapt Building wheel for wrapt (setup.py) ... done Created wheel for wrapt: filename=wrapt-1.12.1-cp38-cp38-win_amd64.whl size=33695 sha256=dca6e09f70e608b8fd88c407c231d7eb7ecad07509b3924e56df327dc865eb74 Stored in directory: C:\Users\Dominique\AppData\Local\Temp\pip-ephem-wheel-cache-0nr_vwa8\wheels\5f\fd\9e\b6cf5890494cb8ef0b5eaff72e5d55a70fb56316007d6dfe73 Successfully built wrapt Installing collected packages: wrapt Successfully installed wrapt-1.12.1

(akida_tf24_py38) C:\Users\Dominique>python Python 3.8.5 (default, Sep 3 2020, 21:29:08) [MSC v.1916 64 bit (AMD64)] :: Anaconda, Inc. on win32 Type "help", "copyright", "credits" or "license" for more information.

import wrapt

smerkousdavid commented 1 year ago

For those that had this issue and the above did not fix then please make sure your pip/setuptools are up to date. My machine is old so I totally forgot to upgrade. sudo -H python3.8 -m pip install pip wheel setuptools --upgrade