简体   繁体   中英

I cant use a python package even after installing it

I want to install bullet,

pip3 install bullet

then run this script

from bullet import Bullet, Check, YesNo, Input

but I get this

ModuleNotFoundError: No module named 'bullet'

Whats happening?

EDIT: I'm using python version 2.7.18

I'm running my script through a file like this:

python3 file.py

which python = /usr/bin/python

which pip3 = /Library/Frameworks/Python.framework/Versions/3.9/bin/pip3

pip3 is the install command for Python 3 and python3 is the command to run a python program with the Python3 interpreter.

You have probably installed bullet to your Python 3 libraries so your Python 2.7.18 will never find the library.

Run Python 3.xx up instead of Python 2.xx

  1. As @MagnusO_O mentioned you can't use pip3 with python version 2. pip3 is the package manager for python version 3.

  2. Your steps are fully correct. Try to verify that your package has been installed. For this run python3 -m pip freeze or pip3 freeze

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM