1

I am trying to build a wheel file file out of a complete python project. I had followed the steps available online to build wheel file. The wheel is built successfully, it gets installed also but when I try to import in the same environment I get a ModuleNotFoundError

I had followed the steps available online to build wheel file.

(sancus) C:\Users\XXXX\Downloads\sancus-master\sancus-master\sancus\dist>pip install sancus_extraction-0.0.1-py3-none-any.whl
Processing c:\users\XXXX\downloads\sancus-master\sancus-master\sancus\dist\sancus_extraction-0.0.1-py3-none-any.whl
Installing collected packages: sancus-extraction
Successfully installed sancus-extraction-0.0.1

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

(sancus) C:\Users\XXXX\Downloads\sancus-master\sancus-master\sancus\dist>python
Python 3.9.13 (main, Aug 25 2022, 23:51:50) [MSC v.1916 64 bit (AMD64)] :: Anaconda, Inc. on win32

Warning:
This Python interpreter is in a conda environment, but the environment has
not been activated.  Libraries may fail to load.  To activate this environment
please see https://conda.io/activation

Type "help", "copyright", "credits" or "license" for more information.
>>> import sancus_extraction
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'sancus_extraction'
>>>
Henry Ecker
  • 34,399
  • 18
  • 41
  • 57
hitesh
  • 11
  • 1
  • 1
    Have you tried checking if `pip --version` outputs the same Python version as your main Python installation, in this case 3.9? – B Remmelzwaal Feb 17 '23 at 13:00
  • Try installing with `python -m pip sancus_extraction-0.0.1-py3-none-any.whl`. – 9769953 Feb 17 '23 at 16:44
  • Did you read the warning? – 9769953 Feb 17 '23 at 16:44
  • @9769953 i tried your suggestion, but i am getting error as unknow command(sancus_wheel) C:\Users\hitesh.singh\Downloads\sancus-master\sancus-master\sancus\dist>python -m pip sancus_extraction-0.0.1-py3-none-any.whl ERROR: unknown command "sancus_extraction-0.0.1-py3-none-any.whl" (sancus_wheel) C:\Users\hitesh.singh\Downloads\sancus-master\sancus-master\sancus\dist>python -m pip sancus_extraction ERROR: unknown command "sancus_extraction" – hitesh Feb 20 '23 at 04:40
  • Slight mistake, although perhaps obvious: I forgot the `install` part: `python -m pip install sancus_extraction-0.0.1-py3-none-any.whl`. – 9769953 Feb 20 '23 at 09:15
  • @9769953 i tried this , now my submodules are not getting found by the program, – hitesh Feb 21 '23 at 05:05
  • You might be in the wrong directory, and picking up the source code instead of the installed package. – 9769953 Feb 21 '23 at 09:02

0 Answers0