blacktwin / JBOPS

Just a Bunch Of Plex Scripts
1.71k stars 304 forks source link

ImportError: No module named plexapi.serverIssue #272

Closed sirloinofbeef closed 3 years ago

sirloinofbeef commented 3 years ago

I have used JBOPS successfully for quite some time. After a server wipe / rebuild though, I am having trouble:

Using the 'plex_api_invite.py' script I get the error:

Traceback (most recent call last): File "C:\scripts\plex\JBOPS-master\utility\plex_api_invite.py", line 42, in from plexapi.server import PlexServer, CONFIG ImportError: No module named plexapi.server

I have double checked plexapi and other requirements using pip install -r requirements.txt

Requirement already satisfied: requests in c:\users\XXXX\appdata\local\programs\python\python39\lib\site-packages (from -r requirements.txt (line 5)) (2.22.0) Requirement already satisfied: plexapi in c:\users\XXXX\appdata\local\programs\python\python39\lib\site-packages (from -r requirements.txt (line 6)) (4.2.0) Requirement already satisfied: urllib3 in c:\users\XXXX\appdata\local\programs\python\python39\lib\site-packages (from -r requirements.txt (line 7)) (1.25.6) Requirement already satisfied: idna<2.9,>=2.5 in c:\users\XXXX\appdata\local\programs\python\python39\lib\site-packages (from requests->-r requirements.txt (line 5)) (2.8) Requirement already satisfied: chardet<3.1.0,>=3.0.2 in c:\users\XXXXX\appdata\local\programs\python\python39\lib\site-packages (from requests->-r requirements.txt (line 5)) (3.0.4) Requirement already satisfied: certifi>=2017.4.17 in c:\users\XXXXX\appdata\local\programs\python\python39\lib\site-packages (from requests->-r requirements.txt (line 5)) (2019.9.11)

blacktwin commented 3 years ago

Can you share the command string you're using?

sirloinofbeef commented 3 years ago

C:\scripts\plex\JBOPS-master\utility\plex_api_invite.py --user XXXXX --libraries "TV Shows" "Movies"

blacktwin commented 3 years ago

What does python --version show?

sirloinofbeef commented 3 years ago

Python 3.9.1

blacktwin commented 3 years ago

pip install --upgrade --force-reinstall plexapi ?

I'm thinking that you may have two versions of python installed. When you call the script in your initial post it's using a version where the plexapi library isn't installed.

plex_api_invite.py --user XXXXX --libraries "TV Shows" "Movies" vs. python plex_api_invite.py --user XXXXX --libraries "TV Shows" "Movies"

sirloinofbeef commented 3 years ago

Your suspicion was right. I had a Python 2 installed as well. All fixed. Thank you!