square / square-python-sdk

Python client library for the Square API
https://developer.squareup.com
Other
101 stars 48 forks source link

ModuleNotFoundError: No module named 'square.client'; 'square' is not a package #62

Closed nadermx closed 3 years ago

nadermx commented 3 years ago

Hi, I'm currently trying to install this, and when I do pip install squareup or even pip install git+https://github.com/square/square-python-sdk.git it shows that it installed fine

(venv)$ pip install squareup
Requirement already satisfied: squareup in ./venv/lib/python3.6/site-packages (12.0.0.20210616)
Requirement already satisfied: jsonpickle<1.0,>=0.7.1 in ./venv/lib/python3.6/site-packages (from squareup) (0.9.6)
Requirement already satisfied: cachecontrol<1.0,>=0.11.7 in ./venv/lib/python3.6/site-packages (from squareup) (0.12.6)
Requirement already satisfied: python-dateutil<3.0,>=2.5.3 in ./venv/lib/python3.6/site-packages (from squareup) (2.8.1)
Requirement already satisfied: requests<3.0,>=2.9.1 in ./venv/lib/python3.6/site-packages (from squareup) (2.25.1)
Requirement already satisfied: deprecation>=2.0.6 in ./venv/lib/python3.6/site-packages (from squareup) (2.1.0)
Requirement already satisfied: msgpack>=0.5.2 in ./venv/lib/python3.6/site-packages (from cachecontrol<1.0,>=0.11.7->squareup) (1.0.2)
Requirement already satisfied: packaging in ./venv/lib/python3.6/site-packages (from deprecation>=2.0.6->squareup) (21.0)
Requirement already satisfied: six>=1.5 in ./venv/lib/python3.6/site-packages (from python-dateutil<3.0,>=2.5.3->squareup) (1.16.0)
Requirement already satisfied: certifi>=2017.4.17 in ./venv/lib/python3.6/site-packages (from requests<3.0,>=2.9.1->squareup) (2021.5.30)
Requirement already satisfied: idna<3,>=2.5 in ./venv/lib/python3.6/site-packages (from requests<3.0,>=2.9.1->squareup) (2.10)
Requirement already satisfied: urllib3<1.27,>=1.21.1 in ./venv/lib/python3.6/site-packages (from requests<3.0,>=2.9.1->squareup) (1.26.5)
Requirement already satisfied: chardet<5,>=3.0.2 in ./venv/lib/python3.6/site-packages (from requests<3.0,>=2.9.1->squareup) (4.0.0)
Requirement already satisfied: pyparsing>=2.0.2 in ./venv/lib/python3.6/site-packages (from packaging->deprecation>=2.0.6->squareup) (2.4.7)

But then when I try and import, I get this

(venv)$ python
Python 3.6.13 (default, May  3 2021, 02:51:47) 
[GCC 9.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from square.client import Client
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/john/PycharmProjects/backgroundremoverapp/square.py", line 1, in <module>
    from square.client import Client
ModuleNotFoundError: No module named 'square.client'; 'square' is not a package
>>> 

I also did this

(venv)$pip -V
pip 21.1.3 from /home/john/PycharmProjects/backgroundremoverapp/venv/lib/python3.6/site-packages/pip (python 3.6)
(venv)$ python -V
Python 3.6.13

But if I do a which square or which squareup it returns nothing. Any help would be appreciated

wolfadex commented 3 years ago

HI @nadermx. My Python is a little rusty but it looks like it's trying to find square in the local directory instead of the one you installed. https://realpython.com/lessons/why-cant-python-find-my-modules/ might be of some help? Let me know if that doesn't help and I'll do what I can to help you get up and running.