-
Notifications
You must be signed in to change notification settings - Fork 87
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
difficulty importing nxviz in Python 3.6.5 #361
Comments
Hi @hansenzoe! Thanks for pinging in. My first hunch is to check that nxviz has been installed into the correct environment. Can you paste the result of the following command in Jupyter? import sys
sys.path This will tell me where your Jupyter kernel is looking for packages. |
Hi Eric! Thank you for getting back to me! Here is the output of the command: import sys ['', |
And just to check, are you working out of the "base" Anaconda environment, or are you using a separate conda environment? |
I am using Anaconda Navigator to launch Jupyter Notebook on a server. (I'm not sure if that answers your question -- I'm fairly new to Python and programming, so I'm sorry for my ignorance!). |
@hansenzoe no worries! Welcome to the Python world 😄. In a Jupyter cell, you can execute bash commands by prefixing them with an exclamation mark. The next command I'd like to see the output for is: ! conda list | grep nxviz # this one if you installed nxviz by using conda. As well as: ! pip list | grep nxviz # this one if you installed nxviz by using pip |
Thanks, Eric! Here is the output I receive (it seems that my Jupyter isn't recognizing the bash commands...). ! conda list | grep nxviz 'grep' is not recognized as an internal or external command, ! pip list | grep nxviz 'grep' is not recognized as an internal or external command, |
Oh yes, that's right, my bad -- grep is a Linux command. Can you do: ! conda list and see if "nxviz" is listed in the long list of things that comes out? |
Running '! conda list' did not display "nxviz". Does this mean that it still needs to be installed somehow? |
Yes, that is right! In your Jupyter notebook, you can do the following to install nxviz: ! conda install nxviz Then try importing. If |
When I try running the "! conda install" command, I receive the following error: Solving environment: ...working... failed PackagesNotFoundError: The following packages are not available from current channels:
Current channels:
Does this indicate that I need to access a different "channel" in order to find the correct package? |
Ah yes, that is right! Apologies, I had taken some settings for granted - I have configured my To get nxviz from conda-forge, use:
The |
Do let me know if it works, and if it does, don't forget to close the issue! |
Hi Eric, |
That definitely looks weird. What if you tried restarting your jupyter notebook server? That would mean closing everything, and shutting down the server in Anaconda Navigator. |
@hansenzoe do let me know how things are! |
Hi Eric! |
@hansenzoe this is beginning to look like an issue unrelated to nxviz, but for which I don't have a clear hypothesis. Installation for nxviz usually should take at most a few minutes on a reasonably modern computer; my experience in new environments is that it's been seconds to install. Windows users in my tutorials also have had few issues. I have also not used a Windows machine regularly for more than 13 years now, so I'm very out-of-date w.r.t. how to debug on Windows machines. The hypotheses that I have below may be helpful for you to debug generally, but I doubt I'll be able to do more than list them out below. Hopefully, you have colleagues around you who might be more knowledgeable about your specific circumstances. Hypothesis 1: Running the installation inside a Jupyter notebook doesn't work.Proposed solution: run the installation command using the command prompt. Hypothesis 2: Jupyter is hangingProposed solution: Kill the Jupyter server, and restart it. Failing that, restart computer. Hypothesis 3: Jupyter and/or Anaconda installation is faulty (highly unlikely, but still a hypothesis)Proposed solution: Remove Anaconda and reinstall it. |
Thank you for the information, Eric! I appreciate you taking the time to help me, despite being unable to figure out the problem! |
My pleasure, @hansenzoe! All the best in your debugging journeys. |
it's really strange, "import nxviz as nz" works fine in python command interface, but not in jupyter notebook. Python 3.6.5 |Anaconda, Inc.| (default, Mar 29 2018, 13:32:41) [MSC v.1900 64 bit (AMD64)] |
@stonegz welcome to the From what I know, it's possibly because you don't have a Python kernel that Jupyter can recognize. To do this, you have to install the kernel: $ conda activate <your_env_name_no_brackets>
$ python -m ipykernel install --user --name <your_env_name_no_brackets> |
Thanks, Eric. Yup, as you guess, the problem is i have two python installations, the default to jupyter is not the one i installed nxviz. |
Hi Eric. I´m having the same issue as @hansenzoe! . I´m trying to install nxviz with python 3.6 on jupyter notebook (Windows 10). This is a virtual environment (the root is python 2.7). Using "!pip install nxviz" on jupyter I get the following error: ERROR: Cannot uninstall 'PyYAML'. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall. When I try with "! conda install nxviz" or "! conda install -c conda-forge nxviz" (from notebook or the anaconda prompt of the virtual environment) the instalation process never ends. Do you any idea? Thanks! |
Try |
Hi @ericmjl, @saurabhiitg I had the same problem with @hansenzoe, I managed to overcome the problem after updating Anaconda navigator and trying |
Description
I am trying to visualize my data in a network, and so began working with the networkx module in Python 3.6.5. The import of networkx worked just fine, but when I attempted to import the nxviz module as well, I received an error message (see below).
What I Did
Any help would be greatly appreciated!
The text was updated successfully, but these errors were encountered: