#πŸ”’ Trying to install from requirements.txt error: Module not found

22 messages Β· Page 1 of 1 (latest)

warm folio
#

Hello! I have set up a virtual environment and installed the torch module in the virtual environment, ensured it using pip list and import torch. Next when I try to install modules from a requirements.txt inside a folder(while running under the same virtual environment), it keeps telling me that the module torch is not found:

          return self._get_build_requires(config_settings, requirements=['wheel'])
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "C:\Users\jakob\AppData\Local\Temp\pip-build-env-5dayfvhi\overlay\Lib\site-packages\setuptools\build_meta.py", line 295, in _get_build_requires
          self.run_setup()
        File "C:\Users\jakob\AppData\Local\Temp\pip-build-env-5dayfvhi\overlay\Lib\site-packages\setuptools\build_meta.py", line 487, in run_setup
          super().run_setup(setup_script=setup_script)
        File "C:\Users\jakob\AppData\Local\Temp\pip-build-env-5dayfvhi\overlay\Lib\site-packages\setuptools\build_meta.py", line 311, in run_setup
          exec(code, locals())
        File "<string>", line 123, in <module>
        File "<string>", line 27, in get_extensions
      ModuleNotFoundError: No module named 'torch'
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

Γ— Getting requirements to build wheel did not run successfully.
β”‚ exit code: 1
╰─> See above for output.```
I think there might be a different alias or a gloabl interpreter it is referring to but I'm not sure how that is possible. I would appreciate any help. Also Im using VS Code.
buoyant elbowBOT
#

@warm folio

Python help channel opened

Remember to:

  • Ask your Python question, not if you can ask or if there's an expert who can help.
  • Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
  • Explain what you expect to happen and what actually happens.

:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.

brazen cargo
#

Are you sure you're running it from inside your virtual environment?

#

How are you running it?

#

If it's through clicking the VS Code buttons you might check that your interpreter there is set correctly.

warm folio
#

I'm running it through the virtual environent

#

Activated environment for venv

#

any other way to ensure?

brazen cargo
#

I'm not sure. Can you do python -m pip list there and see if torch is listed?

#

it may be py -m pip list too

warm folio
#

it is

brazen cargo
#

Ok. Are you trying to run it from the console (python main.py) or through the VS Code UI?

#

If they both give you an error then something is probably borked with your venv configuration

warm folio
#

VS Code has a terminal and im using that

brazen cargo
#

fyi py and python might be pointing to two separate executables (not sure how it's setup on your system).

#

Your virtualenv configuration might be broken though if you're getting errors in the VS Code terminal too. Unfortunately I don't know enough about VS Code to help you fix it.

warm folio
#

pk thanks for the help though appreciate it

buoyant elbowBOT
#
Python help channel closed

This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.