Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PyPi install fails in call to swig. #11

Closed
TimBerberich opened this issue Apr 11, 2022 · 6 comments
Closed

PyPi install fails in call to swig. #11

TimBerberich opened this issue Apr 11, 2022 · 6 comments

Comments

@TimBerberich
Copy link

This might be a problem only on my side but if I try:
pip install pygsl
setup.py bdist_wheel fails in a call to swig:

  Downloading pygsl-2.3.2.tar.gz (1.1 MB)                                                                                                                                                                                                                                                                                                                   
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.1/1.1 MB 13.5 MB/s eta 0:00:00                                                                                                                                                                                                                                                                                               
  Preparing metadata (setup.py) ... done                                                                                                                                                                                                                                                                                                                
Requirement already satisfied: numpy in ./.conda/envs/Py38/lib/python3.8/site-packages (from pygsl) (1.20.3)                                                                                                                                                                                                                                                                 
Building wheels for collected packages: pygsl                                                                                                                                                                                                                                                                                                                               
  Building wheel for pygsl (setup.py) ... error                                                                                                                                                                                                                                                                                                                              
  error: subprocess-exited-with-error                                                                                                                                                                                                                                                                                                       
                                                                                                                                                                                                
  × python setup.py bdist_wheel did not run successfully.                                                                                                                                                                                                                                                                                                                    
  │ exit code: 1                                                                                                                                                                                                                                        
  ╰─> [35 lines of output]                                                                                                                                                                                                                                                                      
      <swig_extension.SWIG_Extension('__callback') at 0x2b407a39bac0>                                                                                                                 sr                                                                                                                                                                                     
      Building testing ufuncs!                                                                                                                                                                                                                                                                                  
      #31 extension modules                                                                                                                                                                                                                                                                         
      running bdist_wheel                                                                                                                                                                                                                                                                   
      running gsl_wrappers                                                                                                                                                                                                                                                                      
      Exporting parser tree using swig: ['swig', '-I/home/berberic/.conda/envs/Py38/include', '-xml', '/tmp/pip-install-_0vu4scu/pygsl_3a4bfad3079e4faaa83f5ca8254cb235/testing/src/sf                                                                                                                                                                                       /sf.i']                                                                                                                                                                                                             
      /home/berberic/.conda/envs/Py38/include/gsl/gsl_sf_legendre.h:375: Error: Syntax error - possibly a missing semicolon.                                                                                                                                                                                                                                                 
      Traceback (most recent call last):                                                                                                                                                                                                                                                                                                                
        File "<string>", line 2, in <module>                                                                                                                                                                                                                                                                                                                            
        File "<pip-setuptools-caller>", line 34, in <module>                                                                                                                                                                                                                                                                                                                 
        File "/tmp/pip-install-_0vu4scu/pygsl_3a4bfad3079e4faaa83f5ca8254cb235/setup.py", line 259, in <module>                                                                                                                                                                                                                                                              
          setup (name = proj_name,                                                                                                                                                                                                                                                                                              
        File "/home/berberic/.conda/envs/Py38/lib/python3.8/site-packages/setuptools/__init__.py", line 153, in setup                                                                                                                                                                                                                                                        
          return distutils.core.setup(**attrs)                                                                                                                                                                                                                                                                                                                               
        File "/home/berberic/.conda/envs/Py38/lib/python3.8/distutils/core.py", line 148, in setup                                                                                                                                                                                                                                                                           
          dist.run_commands()                                                                                                                                                                                                                                                                               
        File "/home/berberic/.conda/envs/Py38/lib/python3.8/distutils/dist.py", line 966, in run_commands                                                                                                                                                                                                                                                                    
          self.run_command(cmd)                                                                                                                                                                                                                                                                                     
        File "/home/berberic/.conda/envs/Py38/lib/python3.8/distutils/dist.py", line 985, in run_command                                                                                                                                                                                                                                                                     
          cmd_obj.run()                                                                                                                                                                                                                                                             
        File "/tmp/pip-install-_0vu4scu/pygsl_3a4bfad3079e4faaa83f5ca8254cb235/setup.py", line 189, in run                                                                                                                                                                                                                                                                   
          self.run_command('gsl_wrappers')                                                                                                                                                                                                                                                                                                                      
        File "/home/berberic/.conda/envs/Py38/lib/python3.8/distutils/cmd.py", line 313, in run_command                                                                                                                                                                                                                                                                      
          self.distribution.run_command(command)                                                                                                                                                                                                                                                                                                                             
        File "/home/berberic/.conda/envs/Py38/lib/python3.8/distutils/dist.py", line 985, in run_command                                                                                                                                                                                                                                                                     
          cmd_obj.run()                                                                                                                                                                                                                                                             
        File "/tmp/pip-install-_0vu4scu/pygsl_3a4bfad3079e4faaa83f5ca8254cb235/gsl_dist/gsl_CodeGenerator.py", line 107, in run
          self._create_ufunc_wrapper()
        File "/tmp/pip-install-_0vu4scu/pygsl_3a4bfad3079e4faaa83f5ca8254cb235/gsl_dist/gsl_CodeGenerator.py", line 93, in _create_ufunc_wrapper
          self._swig_create_xml_file(t_file)
        File "/tmp/pip-install-_0vu4scu/pygsl_3a4bfad3079e4faaa83f5ca8254cb235/gsl_dist/gsl_CodeGenerator.py", line 60, in _swig_create_xml_file
          subprocess.check_call(command)
        File "/home/berberic/.conda/envs/Py38/lib/python3.8/subprocess.py", line 364, in check_call
          raise CalledProcessError(retcode, cmd)                                                                                                                                      sr
      subprocess.CalledProcessError: Command '['swig', '-I/home/berberic/.conda/envs/Py38/include', '-xml', '/tmp/pip-install-_0vu4scu/pygsl_3a4bfad3079e4faaa83f5ca8254cb235/testing/src/sf/sf.i']' returned non-zero exit status 1.
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for pygsl
  Running setup.py clean for pygsl
Failed to build pygsl 

I'm running pip in a conda environment with:

pip version = 22.0.4
swig version = 4.0.2
GSL version = 2.7.1
gcc version = 10.2.0

Any help would be much appreciated.

@clinssen
Copy link
Collaborator

@Berxue: thanks for your report. We just merged #8 which should solve this problem.

Could you try installing via: pip install git+https://github.com/pygsl/pygsl and let us know if that works OK for you? Then we will do a new release on PyPI after. Cheers!

@TimBerberich
Copy link
Author

The install works now thanks !
However there is another problem, I can not import the sf module.

>>> import pygsl.sf
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'pygsl.sf'

Loading other modules (e.g. pygsl.spline) works fine.

@PierreSchnizer
Copy link
Collaborator

PierreSchnizer commented Apr 12, 2022 via email

@clinssen
Copy link
Collaborator

Hmm, these functions seem to have been moved to pygsl.testing at some point, I'm not sure why.

Could you try import pygsl.testing.sf as sf and check that everything then works as expected? Then we can think about moving them back.

@PierreSchnizer
Copy link
Collaborator

PierreSchnizer commented Apr 12, 2022 via email

@TimBerberich
Copy link
Author

Hi,
sorry for the late answer.
Yes importing sf like
>>> import pygsl.testing.sf as sf
works.
Thanks for the great support !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants