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

ModuleNotFoundError when using `! pip install <package> #18

Closed
alexandreCameron opened this issue Feb 26, 2020 · 4 comments
Closed

ModuleNotFoundError when using `! pip install <package> #18

alexandreCameron opened this issue Feb 26, 2020 · 4 comments

Comments

@alexandreCameron
Copy link

Hi,

I quickly tested your package today with a notebook call draft-treon.ipynb with the following cell:

! pip install pandas
import pandas as pd

and ran the command:

pip install treon
treon draft-treon.ipynb

But I got the following error message

Executing treon version 0.1.3
Triggered test for draft-treon.ipynb
ERROR in testing draft-treon.ipynb

An error occurred while executing the following cell:
------------------
! pip install pandas

import pandas as pd
------------------

---------------------------------------------------------------------------
ModuleNotFoundError
Traceback (most recent call last)
<ipython-input-1-0da7781ded87> in <module>()
      1 get_ipython().system(' pip install pandas')
      2
----> 3 import pandas as pd

ModuleNotFoundError: No module named 'pandas'
ModuleNotFoundError: No module named 'pandas'




-----------------------------------------------------------------------
TEST RESULT
-----------------------------------------------------------------------
draft-treon.ipynb       -- FAILED 
-----------------------------------------------------------------------
0 succeeded, 1 failed, out of 1 notebooks tested.
-----------------------------------------------------------------------

What would be the correct procedure to run the test ?

Thanks,

@amit1rrr
Copy link
Member

amit1rrr commented Feb 26, 2020

@alexandreCameron I ran this exact example in a brand new environment & it succeeds. treon execution installs the pandas package & import works as expected.

I'd check couple of things,

  • Can you check if draft-treon.ipynb is saved correctly? get_ipython().system(' pip install pandas') statement in the log looks a bit unfamiliar to me.

  • Are you using virtualenv / condaenv etc.? Does the cmd line environment where you are running treon has all the necessary permissions to pip install packages?

  • As a last resort, can you manually run the pip install step and see if the import succeeds?

@alexandreCameron
Copy link
Author

@amit1rrr :

Can you check if draft-treon.ipynb is saved correctly? get_ipython().system(' pip install pandas') statement in the log looks a bit unfamiliar to me.

I confim the file is saved properly. But I should mention I'm running the code in windows WSL (corporate computer).

Are you using virtualenv / condaenv etc.? Does the cmd line environment where you are running treon has all the necessary permissions to pip install packages?

I'm using a virtualenv, all the permission are OK, and when performing pip freeze in the virtualenv I can see the pandas package.

As a last resort, can you manually run the pip install step and see if the import succeeds?

I can run ! pip install pandas in the notebook without error message and the package is up and running.


The problem could be related to WSL or another corporate security layer on my computer. But I did see where it occurs. I won't feel offended if you close the issue.

@merrcury
Copy link

@amit1rrr Please Close this issue. I have performed the same step & It succeeded. Alex was also able to locate the issue.

@amit1rrr
Copy link
Member

Thanks, closed. What was the issue? It might help someone else running into the same problem.

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

3 participants