Sudo apt install python-setuptools python3.7-dev python3-wheel build-essential and pip install numpy cython matplotlib To install the required packages, after you made sure about (1), you need to run: Pip freeze | grep "" or pip show for more recent versions of pip. You can check this using pip and pip3 to stop any differences that may cause an issue: If this is not the case, you can change your default python using sudo update-alternatives -config python, and following the one-step instruction.Īll the required packages are installed using the right python or pip version. Python -V gives you python3.7 and NOT other version, and pip -V gives you pip 19.2.3 from /home//.local/lib/python3.7/site-packages/pip (python3.7), that actually matches with your default python version. And when you want to check if something is installed, you may check with, for instance, python 3.6 and see that it exists, but you are actually running all your commands with python 3.7. The main source of confusion is that either you did not install the required packages before installing cocoapi, or you did install the required packages but for a different python version. So, other users who may want to use your code, must repeat this installation on their virtual-env as well. That means it is now part of your virtual-env and not part of your project. The installed package, like any other packages that are locally installed inside a virtual-env using pip, will go to External Libraries of your project, under site-packages. This should print out the author's name, which is tsungyi. Inside your project, import (for example) from pycocotools import mask as mask and then print(mask._author_). Now, inside your virtual-env (conda or whatever), first install numpy and cython (and maybe setuptools if it's not installed) using pip, and then: You should see something like pycocotools=2.0.0 in your output. Install it on your local machine, globally (i.e., outside any virtual environment). Instead of the official version (which has issues with python 3) use an alternative one.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |