PokemonGo-Bot icon indicating copy to clipboard operation
PokemonGo-Bot copied to clipboard

no module named pgoapi.exceptions (already pip install -r requirements.txt)

Open andriiaveiro opened this issue 10 years ago • 19 comments

i get this error a

Traceback (most recent call last): File "pokecli.py", line 38, in from pgoapi.exceptions import NotLoggedInException, ServerSideRequestThrottlingException, ServerBusyOrOfflineException ImportError: No module named pgoapi.exceptions

and pip install -r requirements.txt

Command "/root/PokemonGo-Bot/bin/python -u -c "import setuptools, tokenize;file='/tmp/pip-build-b56kJV/xxhash/setup.py';exec(compile(getattr(tokenize, 'open', open)(file).read().replace('\r\n', '\n'), file, 'exec'))" install --record /tmp/pip-44CCiK-record/install-record.txt --single-version-externally-managed --compile --install-headers /root/PokemonGo-Bot/include/site/python2.7/xxhash" failed with error code 1 in /tmp/pip-build-b56kJV/xxhash/

andriiaveiro avatar Aug 07 '16 04:08 andriiaveiro

things have changed. You gotta rm -rf pgoapi and do the pip install again.

solokacher avatar Aug 07 '16 05:08 solokacher

Can you please elaborate.

0xPBIT avatar Aug 07 '16 05:08 0xPBIT

Thank you for the thumb up. I encourage you to read what is pip and how pip works generally.

In this particular case, pip install -r requirements.txt will install all listed package versions to the exact specified version. Most of them work just fine as pip should behave, as they are managed packages of the pypi. The exception here is the pgoapi package, listed on line 3. It is not a pypi package. It is a github repository. Pip handle it badly. In occasions you have to remove the whole repository cloned by pip (rm -rf pgoapi) and do pip install again, i.e. pip install -r requirements.txt

This is a great opportunity to learn python!

---- above was original post ----

Sorry @prestonbrown if I jumped to conclusion to soon. I had quite a lot development packages setup on my mac and by just removing and reinstalling pgoapi worked on my laptop. This issue turned out to likely be more that.

solokacher avatar Aug 07 '16 05:08 solokacher

I understand python. And thank you for a response. However, I do not think that this is the problem. If you could take a second to read this thread that I have been on, it would be very much appreciated.

https://github.com/PokemonGoF/PokemonGo-Bot/issues/2660

0xPBIT avatar Aug 07 '16 05:08 0xPBIT

I get this issue even after doing a fresh build: docker-compose build --no-cache ; so no recycling git checkouts.

zbyte64 avatar Aug 07 '16 06:08 zbyte64

I have run into the very same error.

At first, my git install of requirements.txt failed in regard to the pgoapi with telling me:

Cloning https://github.com/keyphact/pgoapi.git (to 9c070a789029792a75be34aed408906ee3e3653f) to ./src/pgoapi Could not find a tag or branch '9c070a789029792a75be34aed408906ee3e3653f', assuming commit.

Then the requirements.txt got changed, but nevertheless failed, now with

Cloning https://github.com/keyphact/pgoapi.git (to 249d3be7fbbdabc7f9adea17cbc899d6549e47a2) to ./src/pgoapi Could not find a tag or branch '249d3be7fbbdabc7f9adea17cbc899d6549e47a2', assuming commit.

Then I deleted the respective folder's content and cloned the content of 'https://github.com/keyphact/pgoapi.git' manually into it.

I nevertheless get:

File "pokecli.py", line 38, in from pgoapi.exceptions import NotLoggedInException, ServerSideRequestThrottlingException, ServerBusyOrOfflineException ImportError: No module named pgoapi.exceptions

Casual-User avatar Aug 07 '16 06:08 Casual-User

issue close guys :)im just missing python.h and i install again with :

sudo apt-get update; Sudo apt-get install python-dev -y

andriiaveiro avatar Aug 07 '16 07:08 andriiaveiro

I use homebrew on a Mac (for python installs) which does install python-dev capabilities, doesn't it?

Casual-User avatar Aug 07 '16 07:08 Casual-User

Hi ! I have the same Problem with windows ..

`  Failed building wheel for xxhash
  Running setup.py clean for xxhash
Failed to build xxhash
Installing collected packages: xxhash
  Running setup.py install for xxhash ... error
    Complete output from command c:\python27\python.exe -u -c "import setuptools, tokenize;__file__='c:\\users\\logins~1\\appdata\\local\\temp\\pip-build-y80spg\\xxhash\\setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record c:\users\logins~1\appdata\local\temp\pip-rvbaji-record\install-record.txt --single-version-externally-managed --compile:
    running install
    running build
    running build_ext
    building 'xxhash' extension
    error: Le fichier spécifié est introuvable

    ----------------------------------------
Command "c:\python27\python.exe -u -c "import setuptools, tokenize;__file__='c:\\users\\logins~1\\appdata\\local\\temp\\pip-build-y80spg\\xxhash\\setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record c:\users\logins~1\appdata\local\temp\pip-rvbaji-record\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in c:\users\logins~1\appdata\local\temp\pip-build-y80spg\xxhash\`

Con you help me please ?

I have been looking for 2 hours :(

IHG54 avatar Aug 07 '16 07:08 IHG54

install Microsoft Visual C++ Compiler for Python 2.7

https://www.microsoft.com/en-us/download/confirmation.aspx?id=44266

dezayner avatar Aug 07 '16 11:08 dezayner

same problem here on mac osx

Kae2312 avatar Aug 07 '16 16:08 Kae2312

Let's put it in a nutshell:

Mac OS X doesn't have apt-get. There is a package manager called Homebrew that may be used instead. If used, instead of 'apt-get' you have to use the command 'brew'.

After updating Homebrew with 'brew update' (as recommended), I tried to install the Python-Dev package with 'brew install python-dev -y' (following earlier recommendations).

But what I got was the following:

Error: No available formula with the name "python-dev" ==> Searching for similarly named formulae... Error: No similarly named formulae found. ==> Searching taps... Error: No formulae found in taps.

I was told elsewhere that homebrew installations of python would bring -dev capabilities by default. Although that might be wrong, I don't know how to rename the python-dev package to get it brew-installed on a Mac. Any ideas?

Casual-User avatar Aug 07 '16 16:08 Casual-User

In #2843 @BobbyWibowo recommende to reinstall the requirements.txt. ("Try pip2 install -r requirements.txt --upgrade in your bot root.")

I know that my first pgoapi-pip install is/was somehow faulty, as shown in my comment here 9 hours ago. So I also tried as Bobby recommended and got to my surprise

Obtaining pgoapi from git+https://github.com/keyphact/pgoapi.git@249d3be7fbbdabc7f9adea17cbc899d6549e47a2#egg=pgoapi (from -r requirements.txt (line 3)) Skipping because already up-to-date. … Installing collected packages: pgoapi Running setup.py develop for pgoapi Successfully installed pgoapi-1.1.6

Then I tried to start again and got nevertheless:

Traceback (most recent call last): File "pokecli.py", line 38, in from pgoapi.exceptions import NotLoggedInException, ServerSideRequestThrottlingException, ServerBusyOrOfflineException ImportError: No module named pgoapi.exceptions

Still unclear to me, how to proceed

Casual-User avatar Aug 07 '16 16:08 Casual-User

@Casual-User Did you make sure to append --upgrade command? If that doesn't work, do pip2 uninstall pgoapi (may actually not work tho) then do pip2 install -r requirements.txt --upgrade again.

BobbyWibowo avatar Aug 07 '16 16:08 BobbyWibowo

Got the same issue when I upgraded my python (from 2.7.3 to 2.7.12). If you are getting the same issue after upgrading python, you will have to upgrade pip and virtualenv as well before running pip install.

hunlanlin avatar Aug 07 '16 16:08 hunlanlin

Hi Bobby, sorry, I edited the comment above to inform about your recommendations. Yes, I appended the --upgrade command and was so confused that the single module I wanted to upgrade was skipped by the system for already being there. maybe I have to delete it manually before and give it a second try (although I did that yesterday with not much success). Thx, help is much appriciated!

Casual-User avatar Aug 07 '16 16:08 Casual-User

Same issue, like @zbyte64 using Docker. Tried to rm all images/containers but error still here.

Attaching to pokemongobot_bot-user1
bot-user_1    | Traceback (most recent call last):
bot-user_1    |   File "pokecli.py", line 38, in <module>
bot-user_1    |     from pgoapi.exceptions import NotLoggedInException, ServerSideRequestThrottlingException, ServerBusyOrOfflineException
bot-user_1    | ImportError: No module named pgoapi.exceptions
pokemongobot_bot-user1 exited with code 1

tomav avatar Aug 08 '16 21:08 tomav

Same exact issue - I have tried absolute everything here

AlexBailey avatar Aug 10 '16 07:08 AlexBailey

For Windows try this https://download.microsoft.com/download/7/9/6/796EF2E4-801B-4FC4-AB28-B59FBF6D907B/VCForPython27.msi Then pip install -r requirements.txt --upgrade again

permalost avatar Aug 12 '16 05:08 permalost