0

I'm trying to import a module in Jupiter notebook but it has the ModuleNotFoundError. Here's what it looks like:

The code I used to find the paths its looking for the modules:

import sys
sys.executable
sys.path

then it outputs

['/Users/username',
 '/Library/Frameworks/Python.framework/Versions/3.9/lib/python39.zip',
 '/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9',
 '/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/lib-dynload',
 '',
 '/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages',
 '/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/IPython/extensions',
 '/Users/username/.ipython']

Then I attempted to install the package with jupyter notebook

!pip install QuantConnect

and because I installed it before it says

Requirement already satisfied: QuantConnect in /Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages (0.1.0)

But I think this matches one of the places that I thought it was searching for the module. I expected it to work but when I try to import it I get the same error.

import QuantConnect as Qc

---------------------------------------------------------------------------
ModuleNotFoundError                       Traceback (most recent call last)
<ipython-input-6-f774cbf1659e> in <module>
----> 1 import QuantConnect as Qc

ModuleNotFoundError: No module named 'QuantConnect'

I'm using python 3 and I just updated pip to the latest version, nothing I do seems to work.

Wayne
  • 6,607
  • 8
  • 36
  • 93
V N
  • 33
  • 8
  • See my comment below [here](https://stackoverflow.com/a/71463867/8508004). Try the magics with your package name, **but don't capitalize**. See [here](https://pypi.org/project/quantconnect/) it's lower case. – Wayne Mar 16 '22 at 21:31
  • @Wayne [pip is case insensitive](https://stackoverflow.com/questions/26503509/is-pypi-case-sensitive) – FlyingTeller Mar 17 '22 at 10:33
  • I learned a couple things looking into this. Thanks @FlyingTeller – Wayne Mar 17 '22 at 15:32

1 Answers1

1

The package that you installed is this. It is (almost) empty. Looking into your site-packages, you should see no Quantconnect folder, only a QuantConnect_Reserved folder. Also pip show QuantConnect shows:

Name: quantconnect
Version: 0.1.0
Summary: QuantConnect package reserved for future use
Home-page: UNKNOWN
Author: QuantConnect Corp.
Author-email: support@quantconnect.com
License: Apache 2.0
Location: c:\users\...\miniconda3\envs\qc\lib\site-packages
Requires:
Required-by:

Note QuantConnect package reserved for future use. So the package is only a placeholder so that the name is already reserved by the company

FlyingTeller
  • 17,638
  • 3
  • 38
  • 53