I used conda install -c Quantopian zipline
to install the zipline
package in a new conda environment. I activated the conda environment from within VS Code and my settings.json
reads as follows:
{
"python.pythonPath": "C:\\Anaconda3\\envs\\zipline\\python.exe"
}
The bottom bar in my VS Code shows that the 'zipline'
conda environment is being used.
However, the following import statement is throwing a ModuleNotFoundError
.
from zipline.examples import buyapple
Error:
Traceback (most recent call last):
File "d:\Studies\nsedata\zipline_setup.py", line 1, in <module>
from zipline.examples import buyapple
ModuleNotFoundError: No module named 'zipline'
When I am importing the same package from within VS Code terminal, there's no issue:
(base) PS D:\Studies\nsedata> conda activate zipline
(zipline) PS D:\Studies\nsedata> python
Python 3.6.10 |Anaconda, Inc.| (default, May 7 2020, 19:46:08) [MSC v.1916 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> from zipline.examples import buyapple
>>>
What am I doing wrong here and what can be a possible fix? Will appreciate any help on this.