Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ModuleNotFoundError: No module named 'tools.nnwrap' #4

Closed
Johndirr opened this issue Mar 22, 2020 · 3 comments
Closed

ModuleNotFoundError: No module named 'tools.nnwrap' #4

Johndirr opened this issue Mar 22, 2020 · 3 comments

Comments

@Johndirr
Copy link

Johndirr commented Mar 22, 2020

I tried to run this under Windows (Python 3.7 64 bit) Made a clean virtualenvironment and tried to install with pip install jaidedread Then I got the following error:

...
Building wheels for collected packages: jaidedread, torch
  Building wheel for jaidedread (setup.py) ... done
  Created wheel for jaidedread: filename=jaidedread-0.9-py3-none-any.whl size=8504505 sha256=c59571047a4d43b39b9b6985e52c4c9c52be571d668fd1f25b3cfc87a29f90bd
  Stored in directory: c:\users\retrohelix\appdata\local\pip\cache\wheels\0b\d9\e4\10491a2ff91898c9763c6ffdf0121d55b66bee8d2b7ab57317
  Building wheel for torch (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: 'c:\users\retrohelix\envs\jaidedread\scripts\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\RETROH~1\\AppData\\Local\\Temp\\pip-install-2y6jbmgx\\torch\\setup.py'"'"'; __file__='"'"'C:\\Users\\RETROH~1\\AppData\\Local\\Temp\\pip-install-2y6jbmgx\\torch\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d 'C:\Users\RETROH~1\AppData\Local\Temp\pip-wheel-b6i4i0x5'
       cwd: C:\Users\RETROH~1\AppData\Local\Temp\pip-install-2y6jbmgx\torch\
  Complete output (30 lines):
  running bdist_wheel
  running build
  running build_deps
  Traceback (most recent call last):
    File "<string>", line 1, in <module>
    File "C:\Users\RETROH~1\AppData\Local\Temp\pip-install-2y6jbmgx\torch\setup.py", line 265, in <module>
      description="Tensors and Dynamic neural networks in Python with strong GPU acceleration",
    File "c:\users\retrohelix\envs\jaidedread\lib\site-packages\setuptools\__init__.py", line 144, in setup
      return distutils.core.setup(**attrs)
    File "c:\users\retrohelix\appdata\local\programs\python\python37\Lib\distutils\core.py", line 148, in setup
      dist.run_commands()
    File "c:\users\retrohelix\appdata\local\programs\python\python37\Lib\distutils\dist.py", line 966, in run_commands
      self.run_command(cmd)
    File "c:\users\retrohelix\appdata\local\programs\python\python37\Lib\distutils\dist.py", line 985, in run_command
      cmd_obj.run()
    File "c:\users\retrohelix\envs\jaidedread\lib\site-packages\wheel\bdist_wheel.py", line 223, in run
      self.run_command('build')
    File "c:\users\retrohelix\appdata\local\programs\python\python37\Lib\distutils\cmd.py", line 313, in run_command
      self.distribution.run_command(command)
    File "c:\users\retrohelix\appdata\local\programs\python\python37\Lib\distutils\dist.py", line 985, in run_command
      cmd_obj.run()
    File "c:\users\retrohelix\appdata\local\programs\python\python37\Lib\distutils\command\build.py", line 135, in run
      self.run_command(cmd_name)
    File "c:\users\retrohelix\appdata\local\programs\python\python37\Lib\distutils\cmd.py", line 313, in run_command
      self.distribution.run_command(command)
    File "c:\users\retrohelix\appdata\local\programs\python\python37\Lib\distutils\dist.py", line 985, in run_command
      cmd_obj.run()
    File "C:\Users\RETROH~1\AppData\Local\Temp\pip-install-2y6jbmgx\torch\setup.py", line 51, in run
      from tools.nnwrap import generate_wrappers as generate_nn_wrappers
  ModuleNotFoundError: No module named 'tools.nnwrap'
  ----------------------------------------
  ERROR: Failed building wheel for torch
  Running setup.py clean for torch
  ERROR: Command errored out with exit status 1:
   command: 'c:\users\retrohelix\envs\jaidedread\scripts\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\RETROH~1\\AppData\\Local\\Temp\\pip-install-2y6jbmgx\\torch\\setup.py'"'"'; __file__='"'"'C:\\Users\\RETROH~1\\AppData\\Local\\Temp\\pip-install-2y6jbmgx\\torch\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' clean --all
       cwd: C:\Users\RETROH~1\AppData\Local\Temp\pip-install-2y6jbmgx\torch
  Complete output (2 lines):
  running clean
  error: [Errno 2] No such file or directory: '.gitignore'
  ----------------------------------------
  ERROR: Failed cleaning build dir for torch
Successfully built jaidedread
Failed to build torch
ERROR: torchvision 0.5.0 has requirement torch==1.4.0, but you'll have torch 0.1.2.post2 which is incompatible.
Installing collected packages: pyyaml, torch, Pillow, numpy, six, torchvision, opencv-python, scipy, jaidedread
    Running setup.py install for torch ... error
    ERROR: Command errored out with exit status 1:
     command: 'c:\users\retrohelix\envs\jaidedread\scripts\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\RETROH~1\\AppData\\Local\\Temp\\pip-install-2y6jbmgx\\torch\\setup.py'"'"'; __file__='"'"'C:\\Users\\RETROH~1\\AppData\\Local\\Temp\\pip-install-2y6jbmgx\\torch\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\RETROH~1\AppData\Local\Temp\pip-record-mp2uu87x\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\users\retrohelix\envs\jaidedread\include\site\python3.7\torch'
         cwd: C:\Users\RETROH~1\AppData\Local\Temp\pip-install-2y6jbmgx\torch\
    Complete output (23 lines):
    running install
    running build_deps
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "C:\Users\RETROH~1\AppData\Local\Temp\pip-install-2y6jbmgx\torch\setup.py", line 265, in <module>
        description="Tensors and Dynamic neural networks in Python with strong GPU acceleration",
      File "c:\users\retrohelix\envs\jaidedread\lib\site-packages\setuptools\__init__.py", line 144, in setup
        return distutils.core.setup(**attrs)
      File "c:\users\retrohelix\appdata\local\programs\python\python37\Lib\distutils\core.py", line 148, in setup
        dist.run_commands()
      File "c:\users\retrohelix\appdata\local\programs\python\python37\Lib\distutils\dist.py", line 966, in run_commands
        self.run_command(cmd)
      File "c:\users\retrohelix\appdata\local\programs\python\python37\Lib\distutils\dist.py", line 985, in run_command
        cmd_obj.run()
      File "C:\Users\RETROH~1\AppData\Local\Temp\pip-install-2y6jbmgx\torch\setup.py", line 99, in run
        self.run_command('build_deps')
      File "c:\users\retrohelix\appdata\local\programs\python\python37\Lib\distutils\cmd.py", line 313, in run_command
        self.distribution.run_command(command)
      File "c:\users\retrohelix\appdata\local\programs\python\python37\Lib\distutils\dist.py", line 985, in run_command
        cmd_obj.run()
      File "C:\Users\RETROH~1\AppData\Local\Temp\pip-install-2y6jbmgx\torch\setup.py", line 51, in run
        from tools.nnwrap import generate_wrappers as generate_nn_wrappers
    ModuleNotFoundError: No module named 'tools.nnwrap'
    ----------------------------------------
ERROR: Command errored out with exit status 1: 'c:\users\retrohelix\envs\jaidedread\scripts\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\RETROH~1\\AppData\\Local\\Temp\\pip-install-2y6jbmgx\\torch\\setup.py'"'"'; __file__='"'"'C:\\Users\\RETROH~1\\AppData\\Local\\Temp\\pip-install-2y6jbmgx\\torch\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\RETROH~1\AppData\Local\Temp\pip-record-mp2uu87x\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\users\retrohelix\envs\jaidedread\include\site\python3.7\torch' Check the logs for full command output.

Any ideas?

@Johndirr
Copy link
Author

Had to use this methode to install torch (For CUDA 10.0):
pip install torch==1.2.0 torchvision==0.4.0 -f https://download.pytorch.org/whl/torch_stable.html
Installation worked now.

Check: https://pytorch.org/get-started/previous-versions/ for the right installation.

@Johndirr
Copy link
Author

I also had to install the following packages after installing jaidedread:

pip install scikit-image
pip install Pillow==6.1

scikit-image was just missing (ModuleNotFoundError: No module named 'skimage').
And Pillow 7.0.0 was giving the following error: ImportError: cannot import name 'PILLOW_VERSION' from 'PIL'

So this is what you have to install on Windows 10, Python 3.7 64 Bit, CUDA 10.0.

@rkcosmos
Copy link
Contributor

Thanks for the info, I'll update prerequisite and documentation.

rkcosmos added a commit that referenced this issue Oct 12, 2020
thuc-moreh referenced this issue in moreh-dev/EasyOCR Jul 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants