Search code examples
pythonjupyter-notebookvirtual-environment

DLL error while adding the environment into the jupyter notebook


I recently installed anaconda and created a new environment in a different location outside of anaconda base directory. So I created the environment:

python -m venv tfod

Activated it

.\tensorflowenv\Scripts\activate

Upgraded pip and installed ipykernel

python -m pip install --upgrade pip
pip install ipykernel

Issue starts when i try to install/add this new environment into jupyter kernel so I can use this env

python -m ipykernel install --user --name=tensorflowenv

but getting this DLL error

File "D:\project\Tensorflow_obj\TFODCourse\tensorflowenv\lib\site-packages\zmq\backend\cython\__init__.py", line 6, in <module>
    from . import (
ImportError: DLL load failed while importing _device: The file cannot be accessed by the system.

Solution

  • This isn't the exact "solution" for this but its a work around.

    I created an environment using conda navigator and downloaded the required packages from navigator itself and then added the env into jupyter kernel using

    python -m ipykernel install --user --name=tensorflowenv
    

    Still would be happy if someone can provide a actual solution for this