0

I tried to run a script with python, it has taichi package downloaded from GitHub.

I have little knowledge of how python packages are installed, now I got error in command prompt like "ModuleNotFoundError: No module named 'taichi'"

I just installed package downloaded from GitHub: https://pypi.org/project/taichi/#files

Hope someone can teach what should I do to run my script contains taichi package~

4 Answers4

0

To install packages in python you just run the command pip install (name of package) in the command prompt so in your case that would be pip install taichi

RaoufM
  • 525
  • 5
  • 22
0

How to install virtualenv:

Install pip first

sudo apt-get install python3-pip

Then install virtualenv using pip3

sudo pip3 install virtualenv 

Now create a virtual environment

virtualenv venv 

Active your virtual environment:

source venv/bin/activate

Now install your package for python

 pip3 install taichi
Devendra Mishra
  • 77
  • 3
  • 10
  • Thanks! I have followed your procedures successfully until creating virtual environment, a few python interface popped up, then disappeared, then I continue to activate in command line. Error appeared: 'source' is not recognized as an internal or external command, operable program or batch file. Can you tell what I missed to do? – Catherine Kan Jun 25 '20 at 18:00
  • go to folder venv and run . bin/activate – Devendra Mishra Jun 27 '20 at 16:37
  • I went to folder venv, but it told me: '.bin' is not recognized as an internal or external command, operable program or batch file. And I type "dir", there is no .bin file indeed, there were .gitignore, Lib, pyvenv.cfg, Scripts – Catherine Kan Jun 27 '20 at 17:43
0

I have figured it our that this Taichi package needs 64 bits python, it also needs LLMV file downloaded. Besides, there should be virtual studio installed in the local computer. Then this Taichi package can be installed just by using "pip install taichi" in command.

Thanks for everyone's help!

0

I alse encountered this problem,I confirmed that I have already successfully installed taichi whereas it still showed "no module named taichi" .And here is my solution:tryimport sysandsys.path to check whether the file of the packages is contained in python's search range.

For example,after I inputsys.path in python ,it shows ['e:\\', 'd:\\anaconda2022\\python39.zip', 'd:\\anaconda2022\\DLLs', 'd:\\anaconda2022\\lib', 'd:\\anaconda2022', '', 'd:\\anaconda2022\\lib\\site-packages', 'd:\\anaconda2022\\lib\\site-packages\\win32', 'd:\\anaconda2022\\lib\\site-packages\\win32\\lib', 'd:\\anaconda2022\\lib\\site-packages\\Pythonwin']

I am using anaconda as the python interpreter in vscode ,so the packages of taichi is installed in d:\\anaconda2022\\lib\\site-packages,and I can import it successfully . But previously my sys.path are incorrectly setted to E:\\Python but not D:\\anaconda2022. Python cannot find the packages of taichi from the wrong sys.path.

Check the sys.path in python may help.If it is the one which cause the problem , there are many ways to edit sys.path .I solved it by uninstalling the python for I installed python and anaconda at the same time (- -).

TaoLi
  • 11
  • 2