Giter Site home page Giter Site logo

pip install substra fails about substra HOT 7 CLOSED

substra avatar substra commented on August 25, 2024
pip install substra fails

from substra.

Comments (7)

samlesu avatar samlesu commented on August 25, 2024 1

According to the traceback, you are using python 2.7. I don't think substratools supports python 2.7 (and as far as I know it has never been tested).

from substra.

natct10 avatar natct10 commented on August 25, 2024

Can you check if wheel is installed with pip list | grep wheel inside your venv?
If not, please do pip install wheel and retry pip install substra.
src: https://stackoverflow.com/questions/53204916/what-is-the-meaning-of-failed-building-wheel-for-x-in-pip-install

from substra.

RomainGoussault avatar RomainGoussault commented on August 25, 2024

Yes wheel is installed. I had to install it because of a previous error.
The version I use is: 0.34.2

from substra.

natct10 avatar natct10 commented on August 25, 2024

As you are inside a VM, can you please try sudo pip install substra?

from substra.

RomainGoussault avatar RomainGoussault commented on August 25, 2024

Ok it works now, I did the same for substratools.
I have the following error now:

(substra_venv) romain@romain-VirtualBox:~/substra_test$ substra 
Traceback (most recent call last):
  File "/usr/local/bin/substra", line 11, in <module>
    load_entry_point('substra==0.3.0', 'console_scripts', 'substra')()
  File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 480, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 2693, in load_entry_point
    return ep.load()
  File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 2324, in load
    return self.resolve()
  File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 2330, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
  File "/usr/local/lib/python2.7/dist-packages/substra/__init__.py", line 16, in <module>
    from substra.sdk import Client, exceptions
  File "/usr/local/lib/python2.7/dist-packages/substra/sdk/__init__.py", line 15, in <module>
    from substra.sdk.client import Client
  File "/usr/local/lib/python2.7/dist-packages/substra/sdk/client.py", line 36
    data[f'{field_name}_public'] = p['public']
                              ^
SyntaxError: invalid syntax

from substra.

RomainGoussault avatar RomainGoussault commented on August 25, 2024

I tried with python 3 and I am back to the first error message I had (or something very similar) --> #118 (comment)

I do have wheel installed:

(substra_venv) romain@romain-VirtualBox:~$ pip3 list | grep wheel
wheel              0.34.2    
(substra_venv) romain@romain-VirtualBox:~$ pip3 install substra
Collecting substra
  Using cached substra-0.3.0-py3-none-any.whl (36 kB)
Requirement already satisfied: pyyaml in ./substra_venv/lib/python3.6/site-packages (from substra) (5.3)
Requirement already satisfied: keyring in ./substra_venv/lib/python3.6/site-packages (from substra) (21.1.0)
Collecting consolemd
  Using cached consolemd-0.5.1-py2.py3-none-any.whl (12 kB)
Requirement already satisfied: docker in ./substra_venv/lib/python3.6/site-packages (from substra) (4.2.0)
Requirement already satisfied: click in ./substra_venv/lib/python3.6/site-packages (from substra) (7.0)
Requirement already satisfied: requests in ./substra_venv/lib/python3.6/site-packages (from substra) (2.22.0)
Requirement already satisfied: SecretStorage>=3; sys_platform == "linux" in ./substra_venv/lib/python3.6/site-packages (from keyring->substra) (3.1.2)
Requirement already satisfied: jeepney>=0.4.2; sys_platform == "linux" in ./substra_venv/lib/python3.6/site-packages (from keyring->substra) (0.4.2)
Requirement already satisfied: importlib-metadata; python_version < "3.8" in ./substra_venv/lib/python3.6/site-packages (from keyring->substra) (1.5.0)
Collecting setproctitle
  Using cached setproctitle-1.1.10.tar.gz (24 kB)
Requirement already satisfied: pygments in ./substra_venv/lib/python3.6/site-packages (from consolemd->substra) (2.5.2)
Requirement already satisfied: commonmark in ./substra_venv/lib/python3.6/site-packages (from consolemd->substra) (0.9.1)
Requirement already satisfied: websocket-client>=0.32.0 in ./substra_venv/lib/python3.6/site-packages (from docker->substra) (0.57.0)
Requirement already satisfied: six>=1.4.0 in ./substra_venv/lib/python3.6/site-packages (from docker->substra) (1.14.0)
Requirement already satisfied: chardet<3.1.0,>=3.0.2 in ./substra_venv/lib/python3.6/site-packages (from requests->substra) (3.0.4)
Requirement already satisfied: idna<2.9,>=2.5 in ./substra_venv/lib/python3.6/site-packages (from requests->substra) (2.8)
Requirement already satisfied: certifi>=2017.4.17 in ./substra_venv/lib/python3.6/site-packages (from requests->substra) (2019.11.28)
Requirement already satisfied: urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1 in ./substra_venv/lib/python3.6/site-packages (from requests->substra) (1.25.8)
Requirement already satisfied: cryptography in ./substra_venv/lib/python3.6/site-packages (from SecretStorage>=3; sys_platform == "linux"->keyring->substra) (2.8)
Requirement already satisfied: zipp>=0.5 in ./substra_venv/lib/python3.6/site-packages (from importlib-metadata; python_version < "3.8"->keyring->substra) (3.0.0)
Requirement already satisfied: cffi!=1.11.3,>=1.8 in ./substra_venv/lib/python3.6/site-packages (from cryptography->SecretStorage>=3; sys_platform == "linux"->keyring->substra) (1.14.0)
Requirement already satisfied: pycparser in ./substra_venv/lib/python3.6/site-packages (from cffi!=1.11.3,>=1.8->cryptography->SecretStorage>=3; sys_platform == "linux"->keyring->substra) (2.19)
Building wheels for collected packages: setproctitle
  Building wheel for setproctitle (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: /home/romain/substra_venv/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-r223j752/setproctitle/setup.py'"'"'; __file__='"'"'/tmp/pip-install-r223j752/setproctitle/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-c0k20bgl
       cwd: /tmp/pip-install-r223j752/setproctitle/
  Complete output (15 lines):
  running bdist_wheel
  running build
  running build_ext
  building 'setproctitle' extension
  creating build
  creating build/temp.linux-x86_64-3.6
  creating build/temp.linux-x86_64-3.6/src
  x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DSPT_VERSION=1.1.10 -DHAVE_SYS_PRCTL_H=1 -I/usr/include/python3.6m -I/home/romain/substra_venv/include/python3.6m -c src/setproctitle.c -o build/temp.linux-x86_64-3.6/src/setproctitle.o
  In file included from src/spt.h:15:0,
                   from src/setproctitle.c:14:
  src/spt_python.h:14:10: fatal error: Python.h: No such file or directory
   #include <Python.h>
            ^~~~~~~~~~
  compilation terminated.
  error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
  ----------------------------------------
  ERROR: Failed building wheel for setproctitle
  Running setup.py clean for setproctitle
Failed to build setproctitle
Installing collected packages: setproctitle, consolemd, substra
    Running setup.py install for setproctitle ... error
    ERROR: Command errored out with exit status 1:
     command: /home/romain/substra_venv/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-r223j752/setproctitle/setup.py'"'"'; __file__='"'"'/tmp/pip-install-r223j752/setproctitle/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-c_fodoyb/install-record.txt --single-version-externally-managed --compile --install-headers /home/romain/substra_venv/include/site/python3.6/setproctitle
         cwd: /tmp/pip-install-r223j752/setproctitle/
    Complete output (15 lines):
    running install
    running build
    running build_ext
    building 'setproctitle' extension
    creating build
    creating build/temp.linux-x86_64-3.6
    creating build/temp.linux-x86_64-3.6/src
    x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DSPT_VERSION=1.1.10 -DHAVE_SYS_PRCTL_H=1 -I/usr/include/python3.6m -I/home/romain/substra_venv/include/python3.6m -c src/setproctitle.c -o build/temp.linux-x86_64-3.6/src/setproctitle.o
    In file included from src/spt.h:15:0,
                     from src/setproctitle.c:14:
    src/spt_python.h:14:10: fatal error: Python.h: No such file or directory
     #include <Python.h>
              ^~~~~~~~~~
    compilation terminated.
    error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
    ----------------------------------------
ERROR: Command errored out with exit status 1: /home/romain/substra_venv/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-r223j752/setproctitle/setup.py'"'"'; __file__='"'"'/tmp/pip-install-r223j752/setproctitle/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-c_fodoyb/install-record.txt --single-version-externally-managed --compile --install-headers /home/romain/substra_venv/include/site/python3.6/setproctitle Check the logs for full command output.

from substra.

RomainGoussault avatar RomainGoussault commented on August 25, 2024

I had to install python3-dev: sudo apt-get install python3-dev

And now pip3 install substra works :)

from substra.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.