python_webservices_library icon indicating copy to clipboard operation
python_webservices_library copied to clipboard

[Python3] AttributeError: module 'sugarcrm' has no attribute 'Sugarcrm' / ImportError: No module named 'sugarmodule'

Open dagostinelli opened this issue 8 years ago • 0 comments

If I install from git master ImportError: No module named 'sugarmodule'

$ mkdir test
$ cd test
$ virtualenv testenv --python=python3
Running virtualenv with interpreter /usr/bin/python3
Using base prefix '/usr'
New python executable in /home/user/test/testenv/bin/python3
Also creating executable in /home/user/test/testenv/bin/python
Installing setuptools, pip, wheel...done.
$ source testenv/bin/activate
(testenv) $ git clone https://github.com/gddc/python_webservices_library
Cloning into 'python_webservices_library'...
remote: Counting objects: 856, done.
remote: Total 856 (delta 0), reused 0 (delta 0), pack-reused 856
Receiving objects: 100% (856/856), 519.78 KiB | 598.00 KiB/s, done.
Resolving deltas: 100% (465/465), done.
Checking connectivity... done.
(testenv) $ cd python_webservices_library
(testenv) $ pip install .
Processing /home/user/test/python_webservices_library
Collecting simplejson>=2.2 (from sugarcrm==0.3.2)
Collecting six>=1.4.1 (from sugarcrm==0.3.2)
  Using cached six-1.10.0-py2.py3-none-any.whl
Installing collected packages: simplejson, six, sugarcrm
  Running setup.py install for sugarcrm ... done
Successfully installed simplejson-3.8.2 six-1.10.0 sugarcrm-0.3.2
(testenv) $ python
Python 3.5.1 (default, Jul 10 2016, 20:36:01) 
[GCC 6.1.1 20160621 (Red Hat 6.1.1-3)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import sugarcrm
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/user/test/python_webservices_library/sugarcrm/__init__.py", line 2, in <module>
    from sugarmodule import *
ImportError: No module named 'sugarmodule'

>>> 

If I install from PyPi AttributeError: module 'sugarcrm' has no attribute 'Sugarcrm'

$ mkdir test
$ cd test
$ virtualenv testenv --python=python3
Running virtualenv with interpreter /usr/bin/python3
Using base prefix '/usr'
New python executable in /home/user/test/testenv/bin/python3
Also creating executable in /home/user/test/testenv/bin/python
Installing setuptools, pip, wheel...done.
$ source testenv/bin/activate
(testenv) $ pip install sugarcrm
Collecting sugarcrm
Collecting requests (from sugarcrm)
  Downloading requests-2.11.0-py2.py3-none-any.whl (514kB)
    100% |████████████████████████████████| 522kB 1.3MB/s 
Installing collected packages: requests, sugarcrm
Successfully installed requests-2.11.0 sugarcrm-0.1.2
(testenv) $ python
Python 3.5.1 (default, Jul 10 2016, 20:36:01) 
[GCC 6.1.1 20160621 (Red Hat 6.1.1-3)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import sugarcrm
>>> c = sugarcrm.Sugarcrm('blah', 'admin', 'admin')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: module 'sugarcrm' has no attribute 'Sugarcrm'
>>> 

dagostinelli avatar Aug 09 '16 14:08 dagostinelli