SAP / PyRFC

Asynchronous, non-blocking SAP NW RFC SDK bindings for Python
http://sap.github.io/PyRFC
Apache License 2.0
510 stars 137 forks source link

Python 3.5 egg easy_install error #77

Closed thattejada closed 6 years ago

thattejada commented 6 years ago

How can I use the pyrfc-1.9.5-py3.5-linux-x86_64.egg with easy_install? First I downloaded a copy of pyrfc-1.9.5-py3.5-linux-x86_64.egg, then I cd to the download folder and run easy_install pyrfc-1.9.5-py3.5-linux-x86_64.egg but I get this error:

Traceback (most recent call last):
  File "/home/diego/trinidad/env/bin/easy_install", line 11, in <module>
    sys.exit(main())
  File "/home/diego/trinidad/env/lib/python3.5/site-packages/setuptools/command/easy_install.py", line 2315, in main
    **kw
  File "/home/diego/trinidad/env/lib/python3.5/site-packages/setuptools/__init__.py", line 140, in setup
    return distutils.core.setup(**attrs)
  File "/usr/lib/python3.5/distutils/core.py", line 148, in setup
    dist.run_commands()
  File "/usr/lib/python3.5/distutils/dist.py", line 955, in run_commands
    self.run_command(cmd)
  File "/usr/lib/python3.5/distutils/dist.py", line 974, in run_command
    cmd_obj.run()
  File "/home/diego/trinidad/env/lib/python3.5/site-packages/setuptools/command/easy_install.py", line 415, in run
    self.easy_install(spec, not self.no_deps)
  File "/home/diego/trinidad/env/lib/python3.5/site-packages/setuptools/command/easy_install.py", line 657, in easy_install
    return self.install_item(None, spec, tmpdir, deps, True)
  File "/home/diego/trinidad/env/lib/python3.5/site-packages/setuptools/command/easy_install.py", line 702, in install_item
    dists = self.install_eggs(spec, download, tmpdir)
  File "/home/diego/trinidad/env/lib/python3.5/site-packages/setuptools/command/easy_install.py", line 848, in install_eggs
    return [self.install_egg(dist_filename, tmpdir)]
  File "/home/diego/trinidad/env/lib/python3.5/site-packages/setuptools/command/easy_install.py", line 906, in install_egg
    dist = self.egg_distribution(egg_path)
  File "/home/diego/trinidad/env/lib/python3.5/site-packages/setuptools/command/easy_install.py", line 894, in egg_distribution
    metadata = EggMetadata(zipimport.zipimporter(egg_path))
zipimport.ZipImportError: not a Zip file: 'pyrfc-1.9.5-py3.5-linux-x86_64.egg'

I'm using Ubuntu server 16.04

bsrdjan commented 6 years ago

Would you mind using the newest version pyrfc-1.9.93-py3.5-linux-x86_64.egg ? Just tested with easy_install, works fine.

thattejada commented 6 years ago

Hi @bsrdjan, thank you so much for your answer, I'm testing right now...

thattejada commented 6 years ago

After trying easy_install pyrfc-1.9.93-py3.5-linux-x86_64.egg Now I get this error:

Processing pyrfc-1.9.93-py3.5-linux-x86_64.egg
removing '/usr/local/lib/python3.5/dist-packages/pyrfc-1.9.93-py3.5-linux-x86_64.egg' (and everything under it)
creating /usr/local/lib/python3.5/dist-packages/pyrfc-1.9.93-py3.5-linux-x86_64.egg
Extracting pyrfc-1.9.93-py3.5-linux-x86_64.egg to /usr/local/lib/python3.5/dist-packages
pyrfc 1.9.93 is already the active version in easy-install.pth

Installed /usr/local/lib/python3.5/dist-packages/pyrfc-1.9.93-py3.5-linux-x86_64.egg
Processing dependencies for pyrfc==1.9.93
Searching for pyrfc==1.9.93
Reading https://pypi.python.org/simple/pyrfc/
No local packages or working download links found for pyrfc==1.9.93
error: Could not find suitable distribution for Requirement.parse('pyrfc==1.9.93')

Right now I'm looking for that error on Google.

Could you give me some advice?

bsrdjan commented 6 years ago

not sure, can check tomorrow. The setup in which I just created and tested this egg is ubutu:latest based docker:

cd PyRFC
python -V
# Python 3.5.6
easy_install --version
# setuptools 28.8.0 from /home/www-admin/.pyenv/versions/3.5.6/envs/py356/lib/python3.5/site-packages (Python 3.5)
pip uninstall pyrfc # to remove the active pyrfc wheel or egg
python setup.py bdist_egg
easy_install dist/pyrfc-1.9.93-py3.5-linux-x86_64.egg

I remember I sometimes had to run pip uninstall pyrfc twice while testing, once to remove the wheel and once for egg, if both installed.

thattejada commented 6 years ago

I'm trying the installation on Ubuntu server 16.04, Python 3.5.2, I don't know why the installation is trying to reach https://pypi.python.org/simple/pyrfc/

bsrdjan commented 6 years ago

No idea but did you try if pip and wheel work on your system?

Why not use that new standard for binary wheels (https://stackoverflow.com/questions/3220404/why-use-pip-over-easy-install) ?

thattejada commented 6 years ago

Thanks so much @bsrdjan, I'm going to test that approach!!

thattejada commented 6 years ago

Is there a .whl file for installing with python 3? I'm using Python 3.5.2

bsrdjan commented 6 years ago

yes, also the wheel is available, attached to 1.9.93 release:

pyrfc-1.9.93-cp35-cp35m-linux_x86_64.whl

There are too many packages on /dist location anyway and for future releases I would publish them as release attachments only. Need to update the README as well.

thattejada commented 6 years ago

When trying to install...

pip install https://github.com/SAP/PyRFC/releases/download/1.9.93/pyrfc-1.9.93-cp35-cp35m-linux_x86_64.whl
pyrfc-1.9.93-cp35-cp35m-linux_x86_64.whl is not a supported wheel on this platform.

I'm using Ubuntu server 16.04 (64-Bit) What am I doing wrong?

thattejada commented 6 years ago

I think this documentation http://sap.github.io/PyRFC/ should also be updated

bsrdjan commented 6 years ago

I can try to replicate. Could you please post the output of shell comand:

which python

and the welcome message after opening the python interpreter:

python

The system is 64bit, correct?

thattejada commented 6 years ago

Sure!

(env) diego@ubuntu:~/PyRFC$ which python
/home/diego/trinidad/env/bin/python
(env) diego@ubuntu:~/PyRFC$ python -V
Python 3.5.2
(env) diego@ubuntu:~/PyRFC$ python
Python 3.5.2 (default, Nov 23 2017, 16:37:01) 
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> 

I'm using virtualenv

Thanks @bsrdjan

thattejada commented 6 years ago

Hi @bsrdjan, finally after installing a fresh copy of a 64 bit Ubuntu the installation of the wheel file with pip was successfully completed.

Once again, the docs on the README and http://sap.github.io/PyRFC/install.html should be updated.

Now I can summarize the whole process in 2 big steps:

  1. Install the NW RFC library as explained in http://sap.github.io/PyRFC/install.html#sap-nw-rfc-library-installation.
  2. Install with pip the .whl (wheel) file according the Python and System versión (It's easier than fight and get crazy with "easy_install" (it's not that easy)).
    pip install https://github.com/SAP/PyRFC/releases/download/1.9.93/pyrfc-1.9.93-cp35-cp35m-linux_x86_64.whl

Thanks a lot for all your patience and quickly help with this issue these days!