V N
V N

Reputation: 33

How can I fix the Jupiter notebook ModuleNotFoundError for QuantConnect

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.

Upvotes: 0

Views: 491

Answers (1)

FlyingTeller
FlyingTeller

Reputation: 20462

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: [email protected]
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

Upvotes: 1

Related Questions