Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

* nxviz version: 0.6.0 #540

Closed
nwheatle opened this issue Apr 4, 2019 · 4 comments
Closed

* nxviz version: 0.6.0 #540

nwheatle opened this issue Apr 4, 2019 · 4 comments

Comments

@nwheatle
Copy link

nwheatle commented Apr 4, 2019

  • nxviz version:
  • Python version:
  • Operating System:

Description

Describe what you were trying to get done.
Tell us what happened, what went wrong, and what you expected to happen.

What I Did

Paste the command(s) you ran and the output.
If there was a crash, please include the traceback here.
@nwheatle
Copy link
Author

nwheatle commented Apr 4, 2019

*nxviz version: 0.6.0
*python version: 3.7
*operating system: windows 10

Description
I want to import nxviz as nx into my jupyter lab notebook. (Standalone jupyter notebook, no anaconda).
When I install new packages, I open command prompt as admin, then
pip install nxviz
This didn't work easily. I then tried variations of
python -m pip install nxviz and then
pip install --user nxviz
Finally, it appears to work, but I still cannot import the package into jupyter or python console.
Now- this is the output I get
>python -m pip install nxviz

Requirement already satisfied: nxviz in c:\users\nicole wheatley\appdata\roaming\python\python37\site-packages (0.6.0)
Requirement already satisfied: hypothesis==3.82.1 in c:\program files\python37\lib\site-packages (from nxviz) (3.82.1)
Requirement already satisfied: numpy==1.15.4 in c:\program files\python37\lib\site-packages (from nxviz) (1.15.4)
Requirement already satisfied: sphinxcontrib-fulltoc==1.2.0 in c:\program files\python37\lib\site-packages (from nxviz) (1.2.0)
Requirement already satisfied: networkx==2.2 in c:\program files\python37\lib\site-packages (from nxviz) (2.2)
Requirement already satisfied: PyYAML==3.13 in c:\program files\python37\lib\site-packages (from nxviz) (3.13)
Requirement already satisfied: seaborn==0.9.0 in c:\program files\python37\lib\site-packages (from nxviz) (0.9.0)
Requirement already satisfied: cryptography==2.4.1 in c:\program files\python37\lib\site-packages (from nxviz) (2.4.1)
Requirement already satisfied: matplotlib==3.0.2 in c:\users\nicole wheatley\appdata\roaming\python\python37\site-packages (from nxviz) (3.0.2)
Requirement already satisfied: more-itertools==4.3.0 in c:\program files\python37\lib\site-packages (from nxviz) (4.3.0)
Requirement already satisfied: pandas==0.23.4 in c:\program files\python37\lib\site-packages (from nxviz) (0.23.4)
Requirement already satisfied: setuptools==40.6.2 in c:\program files\python37\lib\site-packages (from nxviz) (40.6.2)
Requirement already satisfied: palettable==3.1.1 in c:\program files\python37\lib\site-packages (from nxviz) (3.1.1)
Requirement already satisfied: pytest==4.0.0 in c:\program files\python37\lib\site-packages (from nxviz) (4.0.0)
Requirement already satisfied: attrs>=16.0.0 in c:\program files\python37\lib\site-packages (from hypothesis==3.82.1->nxviz) (18.2.0)
Requirement already satisfied: decorator>=4.3.0 in c:\program files\python37\lib\site-packages (from networkx==2.2->nxviz) (4.3.2)
Requirement already satisfied: scipy>=0.14.0 in c:\program files\python37\lib\site-packages (from seaborn==0.9.0->nxviz) (1.2.1)
Requirement already satisfied: cffi!=1.11.3,>=1.7 in c:\program files\python37\lib\site-packages (from cryptography==2.4.1->nxviz) (1.12.2)
Requirement already satisfied: six>=1.4.1 in c:\program files\python37\lib\site-packages (from cryptography==2.4.1->nxviz) (1.12.0)
Requirement already satisfied: idna>=2.1 in c:\program files\python37\lib\site-packages (from cryptography==2.4.1->nxviz) (2.8)
Requirement already satisfied: asn1crypto>=0.21.0 in c:\program files\python37\lib\site-packages (from cryptography==2.4.1->nxviz) (0.24.0)
Requirement already satisfied: cycler>=0.10 in c:\program files\python37\lib\site-packages (from matplotlib==3.0.2->nxviz) (0.10.0)
Requirement already satisfied: kiwisolver>=1.0.1 in c:\program files\python37\lib\site-packages (from matplotlib==3.0.2->nxviz) (1.0.1)
Requirement already satisfied: pyparsing!=2.0.4,!=2.1.2,!=2.1.6,>=2.0.1 in c:\program files\python37\lib\site-packages (from matplotlib==3.0.2->nxviz) (2.3.1)
Requirement already satisfied: python-dateutil>=2.1 in c:\program files\python37\lib\site-packages (from matplotlib==3.0.2->nxviz) (2.8.0)
Requirement already satisfied: pytz>=2011k in c:\program files\python37\lib\site-packages (from pandas==0.23.4->nxviz) (2018.9)
Requirement already satisfied: py>=1.5.0 in c:\program files\python37\lib\site-packages (from pytest==4.0.0->nxviz) (1.8.0)
Requirement already satisfied: colorama; sys_platform == "win32" in c:\program files\python37\lib\site-packages (from pytest==4.0.0->nxviz) (0.4.1)
Requirement already satisfied: pluggy>=0.7 in c:\program files\python37\lib\site-packages (from pytest==4.0.0->nxviz) (0.9.0)
Requirement already satisfied: atomicwrites>=1.0 in c:\program files\python37\lib\site-packages (from pytest==4.0.0->nxviz) (1.3.0)
Requirement already satisfied: pycparser in c:\program files\python37\lib\site-packages (from cffi!=1.11.3,>=1.7->cryptography==2.4.1->nxviz) (2.19)

Since it seemed to be installed, I tried importing nxviz into jupyter, but error says no such module

import nxviz as nv
ModuleNotFoundError: No module named 'nxviz'

Is module saved in the correct folder? Why is it in appdata/roaming? and not in normal Python37/Lib ?
Do you know what the error could be?

@ericmjl
Copy link
Owner

ericmjl commented Apr 5, 2019

@nwheatle yes, this does look like an issue with the package being installed into the incorrect environment.

One thing that is important for Jupyter users is to ensure that the Python kernel from the environment is accessible by Jupyter. To do this:

activate my_env_name
python -m ipykernel install --user --name my_env_name

Naturally, replace my_env_name with your environment name. Following that, select the appropriate kernel when you create a new Jupyter notebook.

The reason for this architectural design is because you, as a Jupyter user, may want to access both an R and Python kernel installed in the same conda environment, in which that conda environment serves as your data science environment. Hence, it makes no sense to assume that that only one compute kernel is associated with each environment. I learned this the hard way 😄.

Now, if the aforementioned command doesn't work, I would suggest going upstream to Jupyter for help on how to solve this issue, as this is not an issue pertaining to bugs in nxviz's codebase, but rather issues of discovery of Python kernels for Jupyter.

@nwheatle
Copy link
Author

nwheatle commented Apr 5, 2019

Hi Eric,
thank you for responding to my issue.

Despite some online search, I cannot figure out the name of my_env_name. I do not use conda or anaconda. My kernel name in jupyter lab notebook is Python 3.

@JKDev on stackoverflow shows how to find an environment name from jupyter that is using conda environment, https://stackoverflow.com/questions/37085665/in-which-conda-environment-is-jupyter-executing , but I cannot see any env_name that is supposed to show up ~ unless the envname is '3'.

I am following along to your DataCamp course (it's good!). I try to apply the course material to my own computer on jupyter as I go - knowing how to install things, how computers work in general, import the data, etc, is part of the challenge for a biologist entering data science.

image

@ericmjl
Copy link
Owner

ericmjl commented Apr 6, 2019

@nwheatle got it. I would advise using an Anaconda installation of Python, as this would allow you to isolate different environments for different projects. On my old blog, you'll read about why this is important. The short story is that I got utterly confused with where things were getting installed back in my early days of Python, and then came to the realization that I had to properly think about isolated environments in order to not get confused.

Hope the DataCamp course is useful for you 😄. And welcome to the world of data science. There's lots of superpowers to learn!

@ericmjl ericmjl closed this as completed May 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants