1

I'm using Spyder with Python 3.9 and Python 3.7 respectively on Mac and Windows and I got the same issue. I'm trying to import some packages like:

import pythonnet as clr

or

import yfinance as yf

but I get this message:

  File "/var/folders/xs/1_m665393ql86dptnsrft5j80000gn/T/ipykernel_2232/2746914347.py", line 1, in <cell line: 1>
    import pythonnet as clr

ModuleNotFoundError: No module named 'pythonnet'

I'm sure that I already installed these packages from the prompt. I'm facing the following issue with many packages so I suppose is it related to the working directory. This is the directory where -pip installs the package by default:

/Users/user_folder/opt/miniconda3/lib/python3.9/site-packages

I'd to understand if the issue is related to the directory and how to efficiently setup it.

Thank you in advance.

d0whes
  • 11
  • 3
  • Does this answer your question? [ImportError: No module named requests](https://stackoverflow.com/a/73398463/19290081) – Jamiu S. Oct 06 '22 at 22:03

1 Answers1

1

It may be that when you are running the script you are trying to run a different version of python.

When you run the pip install try python3 -m pip install instead.

If this doesn't work and you are using vscode you can simply click in the bottom right where it states the python interpreter and change what you are using.

If all of that fails to work, then sorry but that's all I can suggest with my current knowledge.

cheekysim
  • 106
  • 5