-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
Unable to import pycocotools from script #8
Comments
Uh, nevermind. This was a problem with where the library was installed and which version of Python was being used by iPython. |
So, where should we install the library and which version of Python worked for you? |
I specifically used Python 2.7 installed on my mac using homebrew. The problem was happening because I had installed the package into a virtualenv, but was not using the virtualenv for launching iPython, where I was trying to do the import. |
Can you clarify a little bit more how you fix this error? Thank you. Nevermind, I fixed it as going to /PythonAPI/ and call python setup.py install again. |
The solution differs greatly based on your operating system, use/not-use of virtual environments, how you launched Python, etc. If you elaborate on how you use Python on your system then the solution will become clearer. The basic idea is that you have to install the package in the same version / instance of Python that you are trying to import the package from. |
I have the followings for solving the problem:
And I also have:
|
Thanks monajalal |
@monajalal |
This also another solution for virtual environments. |
@salihkaragoz That workaround does not work anymore. |
It still fails for me. these are the following steps I took $ git clone https://github.com/pdollar/coco.git I open a new notebook in AWS SageMaker in the PythonAPI directory and tried to import pycocotools, it succeeded. |
Same Problem with me. How can i solve it . ModuleNotFoundError: No module named 'pycocotools._mask |
Revert "Minor fix for docs"
I am playing with the pycocotools package and found that I was not able to import pycocotools from a python script, but COULD import it from ipython. For example:
yields
But, doing
Works fine.
Has anyone seen this problem before? I'm working in a virtual environment.
The text was updated successfully, but these errors were encountered: