No module named numpy
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ margin-bottom:0;
}
I am trying to run Jupyter notebook from my Ubuntu subsystem in Windows 10. I've installed numpy, scipy, and pandas using the following commands:
pip install scipy numpy
pip install pandas
When I load python in Ubuntu, there is no issue importing numpy in Ubuntu cmd.
But, when I run my Jupyter Notebook from Ubuntu terminal, and try to import numpy as np, or import pandas as pd, they report
ModuleNotFoundError Traceback (most recent call last)
<ipython-input-1-a9340201ed9f> in <module>
5 import dash_html_components as html
6 import plotly.graph_objs as go
----> 7 import numpy as np
8 from dash.dependencies import Input, Output
9
ModuleNotFoundError: No module named 'numpy'
Is there anyway to solve this issue? Thanks a lot.
16.04 python jupyter numpy pandas
|
show 3 more comments
I am trying to run Jupyter notebook from my Ubuntu subsystem in Windows 10. I've installed numpy, scipy, and pandas using the following commands:
pip install scipy numpy
pip install pandas
When I load python in Ubuntu, there is no issue importing numpy in Ubuntu cmd.
But, when I run my Jupyter Notebook from Ubuntu terminal, and try to import numpy as np, or import pandas as pd, they report
ModuleNotFoundError Traceback (most recent call last)
<ipython-input-1-a9340201ed9f> in <module>
5 import dash_html_components as html
6 import plotly.graph_objs as go
----> 7 import numpy as np
8 from dash.dependencies import Input, Output
9
ModuleNotFoundError: No module named 'numpy'
Is there anyway to solve this issue? Thanks a lot.
16.04 python jupyter numpy pandas
did you run script in to (base) virtual env as per you invoke it manually?
– AtomiX84
Feb 12 at 11:59
no..how do you run that? I am sorry I am new to Ubuntu.
– commentallez-vous
Feb 12 at 12:02
I immage you are in a virtual env due the (base) in the image
– AtomiX84
Feb 12 at 12:04
error like that seems you install all you need in an environment and that modules are not installed in the environment the script run.
– AtomiX84
Feb 12 at 12:05
humm..good question..actually I am not even sure what's wrong. It seems that sudo pip install numpy now shows that I have numpy for Python 2.7, but my Jupyter Notebook runs on Python 3.
– commentallez-vous
Feb 12 at 12:06
|
show 3 more comments
I am trying to run Jupyter notebook from my Ubuntu subsystem in Windows 10. I've installed numpy, scipy, and pandas using the following commands:
pip install scipy numpy
pip install pandas
When I load python in Ubuntu, there is no issue importing numpy in Ubuntu cmd.
But, when I run my Jupyter Notebook from Ubuntu terminal, and try to import numpy as np, or import pandas as pd, they report
ModuleNotFoundError Traceback (most recent call last)
<ipython-input-1-a9340201ed9f> in <module>
5 import dash_html_components as html
6 import plotly.graph_objs as go
----> 7 import numpy as np
8 from dash.dependencies import Input, Output
9
ModuleNotFoundError: No module named 'numpy'
Is there anyway to solve this issue? Thanks a lot.
16.04 python jupyter numpy pandas
I am trying to run Jupyter notebook from my Ubuntu subsystem in Windows 10. I've installed numpy, scipy, and pandas using the following commands:
pip install scipy numpy
pip install pandas
When I load python in Ubuntu, there is no issue importing numpy in Ubuntu cmd.
But, when I run my Jupyter Notebook from Ubuntu terminal, and try to import numpy as np, or import pandas as pd, they report
ModuleNotFoundError Traceback (most recent call last)
<ipython-input-1-a9340201ed9f> in <module>
5 import dash_html_components as html
6 import plotly.graph_objs as go
----> 7 import numpy as np
8 from dash.dependencies import Input, Output
9
ModuleNotFoundError: No module named 'numpy'
Is there anyway to solve this issue? Thanks a lot.
16.04 python jupyter numpy pandas
16.04 python jupyter numpy pandas
edited Feb 12 at 11:47
commentallez-vous
asked Feb 12 at 11:31
commentallez-vouscommentallez-vous
1012
1012
did you run script in to (base) virtual env as per you invoke it manually?
– AtomiX84
Feb 12 at 11:59
no..how do you run that? I am sorry I am new to Ubuntu.
– commentallez-vous
Feb 12 at 12:02
I immage you are in a virtual env due the (base) in the image
– AtomiX84
Feb 12 at 12:04
error like that seems you install all you need in an environment and that modules are not installed in the environment the script run.
– AtomiX84
Feb 12 at 12:05
humm..good question..actually I am not even sure what's wrong. It seems that sudo pip install numpy now shows that I have numpy for Python 2.7, but my Jupyter Notebook runs on Python 3.
– commentallez-vous
Feb 12 at 12:06
|
show 3 more comments
did you run script in to (base) virtual env as per you invoke it manually?
– AtomiX84
Feb 12 at 11:59
no..how do you run that? I am sorry I am new to Ubuntu.
– commentallez-vous
Feb 12 at 12:02
I immage you are in a virtual env due the (base) in the image
– AtomiX84
Feb 12 at 12:04
error like that seems you install all you need in an environment and that modules are not installed in the environment the script run.
– AtomiX84
Feb 12 at 12:05
humm..good question..actually I am not even sure what's wrong. It seems that sudo pip install numpy now shows that I have numpy for Python 2.7, but my Jupyter Notebook runs on Python 3.
– commentallez-vous
Feb 12 at 12:06
did you run script in to (base) virtual env as per you invoke it manually?
– AtomiX84
Feb 12 at 11:59
did you run script in to (base) virtual env as per you invoke it manually?
– AtomiX84
Feb 12 at 11:59
no..how do you run that? I am sorry I am new to Ubuntu.
– commentallez-vous
Feb 12 at 12:02
no..how do you run that? I am sorry I am new to Ubuntu.
– commentallez-vous
Feb 12 at 12:02
I immage you are in a virtual env due the (base) in the image
– AtomiX84
Feb 12 at 12:04
I immage you are in a virtual env due the (base) in the image
– AtomiX84
Feb 12 at 12:04
error like that seems you install all you need in an environment and that modules are not installed in the environment the script run.
– AtomiX84
Feb 12 at 12:05
error like that seems you install all you need in an environment and that modules are not installed in the environment the script run.
– AtomiX84
Feb 12 at 12:05
humm..good question..actually I am not even sure what's wrong. It seems that sudo pip install numpy now shows that I have numpy for Python 2.7, but my Jupyter Notebook runs on Python 3.
– commentallez-vous
Feb 12 at 12:06
humm..good question..actually I am not even sure what's wrong. It seems that sudo pip install numpy now shows that I have numpy for Python 2.7, but my Jupyter Notebook runs on Python 3.
– commentallez-vous
Feb 12 at 12:06
|
show 3 more comments
1 Answer
1
active
oldest
votes
Every python version get its own environment and modules, so a modules installed for python3.x it is not available to python2.x
Also keep in mind that python get also virtual environment and as per before described the modules and libraries installed in a python3 virtual env are not available in to another virtual environment or in the python3 system installation.
To avoid this situation you can use requirements.txt file and install with pip the necessary modules and libraries needed by your app.
an requirements.txt files example:
numpy
panda
and install modules with:
pip install -r requirements.txt
this will install panda and numpy at the latest version, if you want to install them to a specific version create the requirements.txt file like this:
numpy==1.1
panda>=2.5
math>=1.1,<=1.5
the first install numpy exactly at the provided version, the second install panda at any version is major than 2.5 and the last one install math in a version between the provided.
NOTE: (the software version could not match with the real version)
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "89"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1117639%2fno-module-named-numpy%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
Every python version get its own environment and modules, so a modules installed for python3.x it is not available to python2.x
Also keep in mind that python get also virtual environment and as per before described the modules and libraries installed in a python3 virtual env are not available in to another virtual environment or in the python3 system installation.
To avoid this situation you can use requirements.txt file and install with pip the necessary modules and libraries needed by your app.
an requirements.txt files example:
numpy
panda
and install modules with:
pip install -r requirements.txt
this will install panda and numpy at the latest version, if you want to install them to a specific version create the requirements.txt file like this:
numpy==1.1
panda>=2.5
math>=1.1,<=1.5
the first install numpy exactly at the provided version, the second install panda at any version is major than 2.5 and the last one install math in a version between the provided.
NOTE: (the software version could not match with the real version)
add a comment |
Every python version get its own environment and modules, so a modules installed for python3.x it is not available to python2.x
Also keep in mind that python get also virtual environment and as per before described the modules and libraries installed in a python3 virtual env are not available in to another virtual environment or in the python3 system installation.
To avoid this situation you can use requirements.txt file and install with pip the necessary modules and libraries needed by your app.
an requirements.txt files example:
numpy
panda
and install modules with:
pip install -r requirements.txt
this will install panda and numpy at the latest version, if you want to install them to a specific version create the requirements.txt file like this:
numpy==1.1
panda>=2.5
math>=1.1,<=1.5
the first install numpy exactly at the provided version, the second install panda at any version is major than 2.5 and the last one install math in a version between the provided.
NOTE: (the software version could not match with the real version)
add a comment |
Every python version get its own environment and modules, so a modules installed for python3.x it is not available to python2.x
Also keep in mind that python get also virtual environment and as per before described the modules and libraries installed in a python3 virtual env are not available in to another virtual environment or in the python3 system installation.
To avoid this situation you can use requirements.txt file and install with pip the necessary modules and libraries needed by your app.
an requirements.txt files example:
numpy
panda
and install modules with:
pip install -r requirements.txt
this will install panda and numpy at the latest version, if you want to install them to a specific version create the requirements.txt file like this:
numpy==1.1
panda>=2.5
math>=1.1,<=1.5
the first install numpy exactly at the provided version, the second install panda at any version is major than 2.5 and the last one install math in a version between the provided.
NOTE: (the software version could not match with the real version)
Every python version get its own environment and modules, so a modules installed for python3.x it is not available to python2.x
Also keep in mind that python get also virtual environment and as per before described the modules and libraries installed in a python3 virtual env are not available in to another virtual environment or in the python3 system installation.
To avoid this situation you can use requirements.txt file and install with pip the necessary modules and libraries needed by your app.
an requirements.txt files example:
numpy
panda
and install modules with:
pip install -r requirements.txt
this will install panda and numpy at the latest version, if you want to install them to a specific version create the requirements.txt file like this:
numpy==1.1
panda>=2.5
math>=1.1,<=1.5
the first install numpy exactly at the provided version, the second install panda at any version is major than 2.5 and the last one install math in a version between the provided.
NOTE: (the software version could not match with the real version)
answered Feb 12 at 12:29
AtomiX84AtomiX84
965111
965111
add a comment |
add a comment |
Thanks for contributing an answer to Ask Ubuntu!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1117639%2fno-module-named-numpy%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
did you run script in to (base) virtual env as per you invoke it manually?
– AtomiX84
Feb 12 at 11:59
no..how do you run that? I am sorry I am new to Ubuntu.
– commentallez-vous
Feb 12 at 12:02
I immage you are in a virtual env due the (base) in the image
– AtomiX84
Feb 12 at 12:04
error like that seems you install all you need in an environment and that modules are not installed in the environment the script run.
– AtomiX84
Feb 12 at 12:05
humm..good question..actually I am not even sure what's wrong. It seems that sudo pip install numpy now shows that I have numpy for Python 2.7, but my Jupyter Notebook runs on Python 3.
– commentallez-vous
Feb 12 at 12:06