Can't use nba_api - python

I'm trying to use the nba_api module.
I always install my packages on my Mac using the 'pip3 install' command.
Today I installed successfully the nba_api module but I can't use it due to the following error:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'nba_api'
Also, I installed it using the 'pip install' command but I have the same problem.
The interpreter I use is Python 3.9.7.
Any help will be welcomed.

Related

Python cannot find module, pip list does

So, this was my first time making a python package. I tried and tested and got it to work. This meaning that pip install . didn't complain and that
$sudo python3
>>>from LEDController import prettyLight
>>>prettyLight().light('whatsapp',100)
provided expected output and actions in my LED matrix.
Also pip list includes LEDControllerm but as soon as I start python3 anywhere but in the LEDController package directory, the module is not being found.
Running pip install /path/to/LEDController/ is still successfull, as is pip3 install /path/to/LEDController/.
Yet I get
$sudo python3
>>> import LEDController
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'LEDController'
>>> from LEDController import prettyLight
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'LEDController'
What am I missing?
As #sinoroc said, installing only using pip is not the safest option. Instead using python3 -m pip install /path/to/module fixed the issue perfectly.
I'll put his link here so future viewers can read up on why this is.

Installed package Python not recognizing it

I recently tried to create my own pip package. I followed this guide, uploaded to pip. And after I install it python just returns error that module is not found, even if I type pip freeze, the module is installed there.
Also I tried to install it on my Windows pc (prev. machine is Ubuntu) and it doest't work there as well. Any tips?
EDIT:
https://pypi.org/project/PyColours/
The output:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'PyColours'
You named main directory PyColours_pkg so you need to
import PyColours_pkg
Or rename the directory to PyColours, increase version, recreate and reupload the package.

An issue about pysam installation

It's linux, using conda to install pysam, and pip install pysam keep failing.
After successful installed pysam,
pysam shows in conda list and appears in anaconda2/pkgs/
but when import pysam in python 2.7.12, it failed by Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named pysam
PLS help.

I'm having troubles getting pybrain working through anaconda

Here is my problem:
After I managed to install anaconda (having python 3.4), I apparently managed to install pybrain too. But when i use 'import pybrain' from anaconda or from the terminal too I get this error:
>>> import pybrain
Traceback (most recent call last):
File "<ipython-input-2-0fb7233d2a8c>", line 1, in <module>
import pybrain
File "//anaconda/lib/python3.4/site-packages/PyBrain-0.3-py3.4.egg/pybrain/__init__.py", line 1, in <module>
from structure.__init__ import *
ImportError: No module named 'structure'
Simply running sudo pip3 install git+https://github.com/pybrain/pybrain.git worked for me after having the same issue.
The version up on PyPi isn't Python 3 compatible.
Installing the latest commit directly using pip3 should take care of your old package (from PyPi) as well.

Installing python module "undefined symbol: PyString_FromStringAndSize"

I have different python versions installed on my ubuntu machine. The default version is 2.7.
I'm trying to install nfqueue module for version 3.4:
#apt-get install libnetfilter-queue-dev
#pip3 install NetfilterQueue
When I try to test if it is correctly installed I get this error:
>>>import netfilterqueue
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: /usr/local/lib/python3.4/dist-packages/netfilterqueue.cpython-34m.so:undefined symbol: PyString_FromStringAndSize
Has any one an idea what would be the problem??
Thanks!
The function PyString_FromStringAndSize doesn't exist in python 3.x... you need to make sure you're installing the correct nfqueue module

Categories

Resources