pygsl / pygsl Goto Github PK
View Code? Open in Web Editor NEWLicense: GNU General Public License v2.0
License: GNU General Public License v2.0
WARNING: Discarding https://files.pythonhosted.org/packages/0f/82/8bc81042923e474de30a080a551f11a4a352c098a569e6e126f313322735/pygsl-2.3.2.tar.gz#sha256=fa5d018d4421373f5390ac199bc5d484ef317d8358505b35a795bb89f96c8a9c (from https://pypi.org/simple/pygsl/). Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
Using cached pygsl-2.3.0.1.tar.gz (1.1 MB)
ERROR: Command errored out with exit status 1:
command: /Users/adwaitkulkarni/Documents/apps/anaconda3/bin/python -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/_q/bnvmgm191hz962m9y1gcstqw0000gq/T/pip-install-crivcl09/pygsl_92117b3e8fa64e35a869283e2428474a/setup.py'"'"'; file='"'"'/private/var/folders/_q/bnvmgm191hz962m9y1gcstqw0000gq/T/pip-install-crivcl09/pygsl_92117b3e8fa64e35a869283e2428474a/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(file) if os.path.exists(file) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' egg_info --egg-base /private/var/folders/_q/bnvmgm191hz962m9y1gcstqw0000gq/T/pip-pip-egg-info-n4q4x186
cwd: /private/var/folders/_q/bnvmgm191hz962m9y1gcstqw0000gq/T/pip-install-crivcl09/pygsl_92117b3e8fa64e35a869283e2428474a/
Complete output (16 lines):
/Users/adwaitkulkarni/Documents/apps/anaconda3/lib/python3.9/site-packages/setuptools/version.py:1: UserWarning: Module errno was already imported from None, but /private/var/folders/_q/bnvmgm191hz962m9y1gcstqw0000gq/T/pip-install-crivcl09/pygsl_92117b3e8fa64e35a869283e2428474a is being added to sys.path
import pkg_resources
/bin/sh: gsl-config: command not found
Traceback (most recent call last):
File "", line 1, in
File "/private/var/folders/_q/bnvmgm191hz962m9y1gcstqw0000gq/T/pip-install-crivcl09/pygsl_92117b3e8fa64e35a869283e2428474a/setup.py", line 99, in
from gsl_Extension import gsl_Extension
File "/private/var/folders/_q/bnvmgm191hz962m9y1gcstqw0000gq/T/pip-install-crivcl09/pygsl_92117b3e8fa64e35a869283e2428474a/gsl_dist/gsl_Extension.py", line 22, in
from gsl_Location import gsl_Location
File "/private/var/folders/_q/bnvmgm191hz962m9y1gcstqw0000gq/T/pip-install-crivcl09/pygsl_92117b3e8fa64e35a869283e2428474a/gsl_dist/gsl_Location.py", line 158, in
gsl_Location = _gsl_Location_gsl_config()
File "/private/var/folders/_q/bnvmgm191hz962m9y1gcstqw0000gq/T/pip-install-crivcl09/pygsl_92117b3e8fa64e35a869283e2428474a/gsl_dist/gsl_Location.py", line 111, in init
self.prefix = self.get_gsl_info('--prefix').strip()
File "/private/var/folders/_q/bnvmgm191hz962m9y1gcstqw0000gq/T/pip-install-crivcl09/pygsl_92117b3e8fa64e35a869283e2428474a/gsl_dist/gsl_Location.py", line 133, in get_gsl_info
raise DistutilsExecError("could not start %s"%self.gsl_config_tool)
distutils.errors.DistutilsExecError: could not start gsl-config
----------------------------------------
WARNING: Discarding https://files.pythonhosted.org/packages/17/fc/9c11163f017a0d6877141d4d4edb619b0f05990d865caab840a2d0463581/pygsl-2.3.0.1.tar.gz#sha256=b248a899a9df0b94996fd5fe070f8ecbd3d42ca07486a829dedcdfdd70a3337d (from https://pypi.org/simple/pygsl/). Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
Using cached pygsl-2.1.1.tar.gz (733 kB)
ERROR: Command errored out with exit status 1:
command: /Users/adwaitkulkarni/Documents/apps/anaconda3/bin/python -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/_q/bnvmgm191hz962m9y1gcstqw0000gq/T/pip-install-crivcl09/pygsl_aa60613eeea3405eb880491abe461bed/setup.py'"'"'; file='"'"'/private/var/folders/_q/bnvmgm191hz962m9y1gcstqw0000gq/T/pip-install-crivcl09/pygsl_aa60613eeea3405eb880491abe461bed/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(file) if os.path.exists(file) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' egg_info --egg-base /private/var/folders/_q/bnvmgm191hz962m9y1gcstqw0000gq/T/pip-pip-egg-info-58_14dp1
cwd: /private/var/folders/_q/bnvmgm191hz962m9y1gcstqw0000gq/T/pip-install-crivcl09/pygsl_aa60613eeea3405eb880491abe461bed/
Complete output (18 lines):
/bin/sh: gsl-config: command not found
Traceback (most recent call last):
File "", line 1, in
File "/private/var/folders/_q/bnvmgm191hz962m9y1gcstqw0000gq/T/pip-install-crivcl09/pygsl_aa60613eeea3405eb880491abe461bed/setup.py", line 74, in
from gsl_Extension import gsl_Extension
File "/private/var/folders/_q/bnvmgm191hz962m9y1gcstqw0000gq/T/pip-install-crivcl09/pygsl_aa60613eeea3405eb880491abe461bed/gsl_dist/gsl_Extension.py", line 138, in
gsl_Location = _gsl_Location_gsl_config()
File "/private/var/folders/_q/bnvmgm191hz962m9y1gcstqw0000gq/T/pip-install-crivcl09/pygsl_aa60613eeea3405eb880491abe461bed/gsl_dist/gsl_Extension.py", line 93, in init
self.prefix = self.get_gsl_info('--prefix').strip()
File "/private/var/folders/_q/bnvmgm191hz962m9y1gcstqw0000gq/T/pip-install-crivcl09/pygsl_aa60613eeea3405eb880491abe461bed/gsl_dist/gsl_Extension.py", line 114, in get_gsl_info
raise DistutilsExecError("could not start %s"%self.gsl_config_tool)
distutils.errors.DistutilsExecError: could not start gsl-config
No array object was selected.
No array object was selected.
Looking for a suitable array moduleSELECTED a NEW array module ->numpy
Please make sure that all modules are built with the same setting.
e.g. remove the build directory and start the build process again!
numpy
----------------------------------------
WARNING: Discarding https://files.pythonhosted.org/packages/38/d9/ac760af4d74a99d757bf93c5d29dd7847ad40b761d090527b69484f4ac5b/pygsl-2.1.1.tar.gz#sha256=052ef186d499332a325edd0d46a0f9ae0726050da07f2328cfd659d620e2be33 (from https://pypi.org/simple/pygsl/). Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
ERROR: Could not find a version that satisfies the requirement pygsl (from versions: 2.1.1, 2.3.0.1, 2.3.2)
ERROR: No matching distribution found for pygsl
(base) Phy8s-Mac-Studio:~ adwaitkulkarni$
I have Windows 10 (64bit), Visual Studio 2019, Python 3.10. I have installed MSYS2 (C:\msys64). I have installed numpy-1.25.2 and gsl-2.7.1 in virtual environment. I unpacked 'pygsl-2.3.3.tar.gz' in C:\Projects\GSL2. I created 'gsl_site.py' in 'gsl_dist' folder:
prefix = os.path.join("C:\", "msys64", "usr")
cflags = "-g -I" + os.path.join(prefix, "include")
libs = "-L" + os.path.join(prefix, "lib")+ " -lgsl -lgslcblas -lm"
version = "2.7"
swig = os.path.join("C:\", "swigwin-4.1.1", "swig")
In Mingw64 command line I try to install pygsl. I type python setup.py config --compiler=mingw32
and have an error:
Traceback (most recent call last):
...
File "C:\python310\lib\distutils\cygwinccompiler.py", line 84, in get_msvcr
raise ValueError("Unknown MS Compiler version %s " % msc_ver)
ValueError: Unknown MS Compiler version 1929
I apply patch for 'cygwinccompiler.py':
...
elif msc_ver == '1700':
# Visual Studio 2012 / Visual C++ 11.0
return ['msvcr110']
elif msc_ver == '1800':
# Visual Studio 2013 / Visual C++ 12.0
return ['msvcr120']
elif msc_ver == '1900':
# Visual Studio 2015 / Visual C++ 14.0
# "msvcr140.dll no longer exists" http://blogs.msdn.com/b/vcblog/archive/2014/06/03/visual-studio-14-ctp.aspx
return ['vcruntime140']
elif msc_ver == '1929':
return ['vcruntime140']
else:
#to do: can we make this futureproof?
raise ValueError("Unknown MS Compiler version %s " % msc_ver)
...
Setup config results an error:
<swig_extension.SWIG_Extension('__callback') at 0x1b0ff9b2650>
Building testing ufuncs!
#31 extension modules
running config
dllwrap: WARNING: dllwrap is deprecated, use gcc -shared or ld -shared instead
Looking for python310.dll
INFO: Building import library (arch=AMD64): "C:\Projects\GSL2\venv\libs\libpython310.a" (from C:\python310\python310.dll)
error: [Errno 2] No such file or directory: 'C:\Projects\GSL2\venv\libs\python310.def'
I copy 'python3.lib', 'python310.lib' and '_tkinter.lib' from C:\python310\libs to venv\libs in virtual environment. Setup config results an error:
Traceback (most recent call last):
...
File "C:\python310\lib\distutils\unixccompiler.py", line 90, in preprocess
pp_args = self.preprocessor + pp_opts
TypeError: unsupported operand type(s) for +: 'NoneType' and 'list'
In 'unixcompiler.py' I replaced the line
pp_args = self.preprocessor + pp_opts
with
pp_args = pp_opts
pp_args.insert(0, self.preprocessor)
Setup config results an error:
Traceback (most recent call last):
...
File "C:\Projects\GSL2\venv\lib\site-packages\numpy\distutils\ccompiler.py", line 141, in CCompiler_spawn
display = ' '.join(list(display))
TypeError: sequence item 0: expected str instance, NoneType found
display: [None, '-D__MSVCRT_VERSION__=0x1929', '-IC:\msys64\mingw64\include', '-o', '_configtest.i', '_configtest.c']
In 'ccompiler.py' I add the clause before join:
...
if display[0] == None:
display.remove(None)
I have errors:
...
INFO: C compiler: gcc -g -DDEBUG -DMS_WIN64 -O0 -Wall -Wstrict-prototypes
INFO: compile options: '-D__MSVCRT_VERSION__=0x1929 -IC:\msys64\mingw64\include -c'
INFO: gcc -g -DDEBUG -DMS_WIN64 -O0 -Wall -Wstrict-prototypes -D__MSVCRT_VERSION__=0x1929 -IC:\msys64\mingw64\include -c _configtest.c -o _configtest.o
_configtest.c:3:5: warning: function declaration isn't a prototype [-Wstrict-prototypes]
INFO: gcc -g _configtest.o -LC:\msys64\mingw64\lib -lgsl -lgslcblas -lm -o _configtest.exe
success!
removing: _configtest.c configtest.o configtest.exe
INFO: -D__MSVCRT_VERSION=0x1929 -IC:\msys64\mingw64\include -o _configtest.i _configtest.c
[WinError 2] The system cannot find the file specified
removing: configtest.c configtest.i
INFO: -D__MSVCRT_VERSION=0x1929 -IC:\msys64\mingw64\include -o _configtest.i _configtest.c
[WinError 2] The system cannot find the file specified
removing: configtest.c configtest.i
INFO: -D__MSVCRT_VERSION=0x1929 -IC:\msys64\mingw64\include -o _configtest.i _configtest.c
[WinError 2] The system cannot find the file specified
removing: configtest.c configtest.i
INFO: -D__MSVCRT_VERSION=0x1929 -IC:\msys64\mingw64\include -o _configtest.i _configtest.c
[WinError 2] The system cannot find the file specified
removing: _configtest.c _configtest.i
...
How can I overcome this and install pygsl?
For some reason this example doesn't work for me.
Python 3.10.12 (main, Nov 20 2023, 15:14:05) [GCC 11.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
from pygsl import rng
r = rng.mt19937_1998()
phi = (0.2,0.2,0.2,0.4)
k = 5
n = r.multinomial(phi, k, 10)
Traceback (most recent call last):
File "", line 1, in
ValueError: object of too small depth for desired array
Being new to using this library I'd appreciate any help.
I was installing pygsl on my mac. Its updated mac with Mac Os Sonoma (Version 14.0 (23A344)). As Written in documentation i Followed all instructions for installations.
Here its terminal code:
Phy8s-Mac-Studio:~ adwaitkulkarni$ conda install wheel
Collecting package metadata (current_repodata.json): done
Solving environment: done
==> WARNING: A newer version of conda exists. <==
current version: 23.3.1
latest version: 23.10.0
Please update conda by running
conda update -n base -c defaults conda
Or to minimize the number of packages updated during conda update use
conda install conda=23.10.0
All requested packages already installed.
Phy8s-Mac-Studio:~ adwaitkulkarni$ cd Downloads/
Phy8s-Mac-Studio:Downloads adwaitkulkarni$ cd pygsl.2.3.3
-bash: cd: pygsl.2.3.3: No such file or directory
Phy8s-Mac-Studio:Downloads adwaitkulkarni$ cd pygsl-2.3.3
Phy8s-Mac-Studio:pygsl-2.3.3 adwaitkulkarni$ python3 setup.py gsl_wrappers
Traceback (most recent call last):
File "/Users/adwaitkulkarni/Downloads/pygsl-2.3.3/setup.py", line 92, in
from wheel.bdist_wheel import bdist_wheel as _bdist_wheel
ModuleNotFoundError: No module named 'wheel'
Phy8s-Mac-Studio:pygsl-2.3.3 adwaitkulkarni$ conda activate
(base) Phy8s-Mac-Studio:pygsl-2.3.3 adwaitkulkarni$ python3 setup.py gsl_wrappers
/bin/sh: gsl-config: command not found
Traceback (most recent call last):
File "/Users/adwaitkulkarni/Downloads/pygsl-2.3.3/setup.py", line 99, in
from gsl_Extension import gsl_Extension
File "/Users/adwaitkulkarni/Downloads/pygsl-2.3.3/gsl_dist/gsl_Extension.py", line 22, in
from gsl_Location import gsl_Location
File "/Users/adwaitkulkarni/Downloads/pygsl-2.3.3/gsl_dist/gsl_Location.py", line 158, in
gsl_Location = _gsl_Location_gsl_config()
File "/Users/adwaitkulkarni/Downloads/pygsl-2.3.3/gsl_dist/gsl_Location.py", line 111, in init
self.prefix = self.get_gsl_info('--prefix').strip()
File "/Users/adwaitkulkarni/Downloads/pygsl-2.3.3/gsl_dist/gsl_Location.py", line 133, in get_gsl_info
raise DistutilsExecError("could not start %s"%self.gsl_config_tool)
distutils.errors.DistutilsExecError: could not start gsl-config
Newer versions of pip cannot install the latest pygsl from PyPI, because the version number in the package metadata (in
Line 17 in 1430c11
pygsl-2.3.0.1.tar.gz
). The fourth digit is not as prescribed by the "semantic versioning" system, so perhaps we should take this opportunity to remove it altogether, and do a new release with version number 2.3.1. This should solve the pip install issue.
The error message from pip is:
WARNING: Discarding https://files.pythonhosted.org/packages/17/fc/9c11163f017a0d6877141d4d4edb619b0f05990d865caab840a2d0463581/pygsl-2.3.0.1.tar.gz#sha256=b248a899a9df0b94996fd5fe070f8ecbd3d42ca07486a829dedcdfdd70a3337d (from https://pypi.org/simple/pygsl/). Requested pygsl from file:///home/clinssen/.cache/pip/wheels/4b/d0/ab/9f52c8f2cc5f2a785992894d4be820e6223cadbd70c1496862/pygsl-2.3.0-cp35-cp35m-linux_x86_64.whl has different version in metadata: '2.3.0'
See #11.
[...] Achim originally implemented the module sf. I started way back (15 years ago or so) to implement these functions as Numeric/numarray/numpy universal functions.
I started to implement them as testing ones ...
I think fpr the next major release these should be shifted over to pygsl.sf ...
Windows 10 Pro 64bit, Python 3.11.4:
pip install -U pygsl
Collecting pygsl
Downloading pygsl-2.3.3.tar.gz (1.1 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.1/1.1 MB 8.6 MB/s eta 0:00:00
Installing build dependencies ... done
Getting requirements to build wheel ... error
error: subprocess-exited-with-error
× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> [36 lines of output]
Traceback (most recent call last):
File "C:\Users\mlap\AppData\Local\Temp\pip-install-43om8uhc\pygsl_79de1370e4ec4a408c9b2e164f15cda6\gsl_dist\gsl_Location.py", line 141, in init
import gsl_site
ModuleNotFoundError: No module named 'gsl_site'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Python311\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 353, in <module>
main()
File "C:\Python311\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 335, in main
json_out['return_val'] = hook(**hook_input['kwargs'])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Python311\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 118, in get_requires_for_build_wheel
return hook(config_settings)
^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\mlap\AppData\Local\Temp\pip-build-env-4r14593i\overlay\Lib\site-packages\setuptools\build_meta.py", line 341, in get_requires_for_build_wheel
return self._get_build_requires(config_settings, requirements=['wheel'])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\mlap\AppData\Local\Temp\pip-build-env-4r14593i\overlay\Lib\site-packages\setuptools\build_meta.py", line 323, in _get_build_requires
self.run_setup()
File "C:\Users\mlap\AppData\Local\Temp\pip-build-env-4r14593i\overlay\Lib\site-packages\setuptools\build_meta.py", line 338, in run_setup
exec(code, locals())
File "<string>", line 99, in <module>
File "C:\Users\mlap\AppData\Local\Temp\pip-install-43om8uhc\pygsl_79de1370e4ec4a408c9b2e164f15cda6\gsl_dist\gsl_Extension.py", line 22, in <module>
from gsl_Location import gsl_Location
File "C:\Users\mlap\AppData\Local\Temp\pip-install-43om8uhc\pygsl_79de1370e4ec4a408c9b2e164f15cda6\gsl_dist\gsl_Location.py", line 160, in <module>
gsl_Location = _gsl_Location_file()
^^^^^^^^^^^^^^^^^^^^
File "C:\Users\mlap\AppData\Local\Temp\pip-install-43om8uhc\pygsl_79de1370e4ec4a408c9b2e164f15cda6\gsl_dist\gsl_Location.py", line 148, in __init__
raise DistutilsExecError(msg % des)
distutils.errors.DistutilsExecError: I do not know how to run gsl-config
on this system. Therefore you must provide me with the information
where to find the GSL library. I could not import `gsl_site'.
Reason: No module named 'gsl_site'. Copy gsl_site_example.py to gsl_site.py.
Edit the variables in that file to reflect your installation.
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error
× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> See above for output.
note: This error originates from a subprocess, and is likely not a problem with pip.
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.
This report comes from trying to build a package for the Python 3.13 in Fedora:
Trying to compile this with gcc 14 I get these errors:
swig_src/odeiv2_wrap.c:4336:66: error: passing argument 2 of ‘_pygsl_odeiv2_check_step_jacobian’ from incompatible pointer type [-Wincompatible-pointer-types]
4336 | status = _pygsl_odeiv2_check_step_jacobian(step, &sys->dydt);
| ^~~~~~~~~~
| |
| const gsl_odeiv2_system *
swig_src/odeiv2_wrap.c:3548:104: note: expected ‘const pygsl_odeiv2_system *’ but argument is of type ‘const gsl_odeiv2_system *’
3548 | static int _pygsl_odeiv2_check_step_jacobian(const pygsl_odeiv2_step *step, const pygsl_odeiv2_system *sys)
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
swig_src/odeiv2_wrap.c: In function ‘pygsl_odeiv2_driver_apply_fixed_step’:
swig_src/odeiv2_wrap.c:4513:89: error: passing argument 2 of ‘_pygsl_odeiv2_check_step_jacobian’ from incompatible pointer type [-Wincompatible-pointer-types]
4513 | status = _pygsl_odeiv2_check_step_jacobian(self->driver->s, self->driver->sys);
| ~~~~~~~~~~~~^~~~~
| |
| const gsl_odeiv2_system *
swig_src/odeiv2_wrap.c:3548:104: note: expected ‘const pygsl_odeiv2_system *’ but argument is of type ‘const gsl_odeiv2_system *’
3548 | static int _pygsl_odeiv2_check_step_jacobian(const pygsl_odeiv2_step *step, const pygsl_odeiv2_system *sys)
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
swig_src/odeiv2_wrap.c: In function ‘pygsl_odeiv2_driver_apply’:
swig_src/odeiv2_wrap.c:4554:89: error: passing argument 2 of ‘_pygsl_odeiv2_check_step_jacobian’ from incompatible pointer type [-Wincompatible-pointer-types]
4554 | status = _pygsl_odeiv2_check_step_jacobian(self->driver->s, self->driver->sys);
| ~~~~~~~~~~~~^~~~~
| |
| const gsl_odeiv2_system *
swig_src/odeiv2_wrap.c:3548:104: note: expected ‘const pygsl_odeiv2_system *’ but argument is of type ‘const gsl_odeiv2_system *’
3548 | static int _pygsl_odeiv2_check_step_jacobian(const pygsl_odeiv2_step *step, const pygsl_odeiv2_system *sys)
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
...
error: command '/usr/bin/gcc' failed with exit code 1
This is quite reasonable because (in the same file):
typedef struct{
gsl_odeiv2_system dydt;
PyGSL_odeiv_parameter_pass params;
} pygsl_odeiv2_system;
expected ‘const pygsl_odeiv2_system *’ but argument is of type ‘const gsl_odeiv2_system *’
And so it is not possible to replace a gsl_odeiv2_system by a pygsl_odeiv2_system.
The work being done here is in order to prepare for Python 3.13 in Fedora.
https://numpy.org/doc/stable/reference/distutils_status_migration.html#distutils-status-migration
There is a failure in Fedora 40 due to
+ /usr/bin/python3 setup.py gsl_wrappers
/builddir/build/BUILD/pygsl-2.3.3/gsl_dist/gsl_Location.py:63: SyntaxWarning: invalid escape sequence '\.'
return re.split('\.',version)
Traceback (most recent call last):
File "/builddir/build/BUILD/pygsl-2.3.3/gsl_dist/gsl_Extension.py", line 25, in <module>
from array_includes import array_include_dirs
File "/builddir/build/BUILD/pygsl-2.3.3/gsl_dist/array_includes.py", line 7, in <module>
from numpy.distutils.misc_util import get_numpy_include_dirs
ModuleNotFoundError: No module named 'numpy.distutils'
https://numpy.org/doc/stable/reference/distutils_status_migration.html#distutils-status-migration
This can be easily solved since pygsl only uses a single call that has a direct equivalent in numpy
:
-array_include_dirs = []
-from numpy.distutils.misc_util import get_numpy_include_dirs
-array_include_dirs = get_numpy_include_dirs()
+import numpy
+array_include_dirs = [ numpy.get_include() ]
import pygsl.errno
ModuleNotFoundError: No module named 'pygsl.errno'
Version: PyGSL 2.3.3
Platform: Ubuntu 18.04
test.py
import pygsl.sf
print("%g+/-%g"%pygsl.sf.erf(1))
Dear pygsl
devs,
apologies if this is not the right forum to bring this up. I was wondering if it would be possible to have a new pypi release of pygsl
in the next few weeks.
Many thanks,
Sergei
When trying to build pygsl
from source one can encounter errors like the following:
INFO: gcc: swig_src/hankel_wrap.c
swig_src/hankel_wrap.c:3096:3: error: implicit declaration of function '_PyObject_GC_UNTRACK' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
_PyObject_GC_UNTRACK(descr);
This is related to the fact that these macros have been removed from Python API as per:
https://docs.python.org/3/c-api/gcsupport.html#c.PyObject_GC_UnTrack
This can be fixed by regenerating the files in swig_src
with swig >= 4.0
. Not clear if this has impact on python<3.8
I install pygsl with the following command:
pip install --force-reinstall pygsl
Then a very long error message appears. Below is an excerpt from the output.
My guess is that pyglsl does not work with the new numpy v2.0.0.
Collecting pygsl
Downloading pygsl-2.3.3.tar.gz (1.1 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.1/1.1 MB 7.8 MB/s eta 0:00:00
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing metadata (pyproject.toml) ... done
Collecting numpy (from pygsl)
Using cached numpy-2.0.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (60 kB)
Using cached numpy-2.0.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (19.3 MB)
Building wheels for collected packages: pygsl
Building wheel for pygsl (pyproject.toml) ... error
error: subprocess-exited-with-error× Building wheel for pygsl (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [898 lines of output]
.
.
.
.
44 | #include <crypt.h>
| ^~~~~~~~~
compilation terminated.
error: Command "/root/miniforge3/envs/test/bin/x86_64-conda-linux-gnu-cc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -fPIC -O2 -isystem /root/miniforge3/envs/test/include -fPIC -O2 -isystem /root/miniforge3/envs/test/include -march=nocona -mtune=haswell -ftree-vectorize -fPIC -fstack-protector-strong -fno-plt -O2 -ffunction-sections -pipe -isystem /root/miniforge3/envs/test/include -DNDEBUG -D_FORTIFY_SOURCE=2 -O2 -isystem /root/miniforge3/envs/test/include -fPIC -DSWIG_COBJECT_TYPES=1 -DDEBUG=1 -DPyGSL_SET_GSL_ERROR_HANDLER=1 -DNUMERIC=0 -UNDEBUG -I/root/miniforge3/envs/test/include -IInclude -I. -I/tmp/pip-build-env-jty681z1/overlay/lib/python3.10/site-packages/numpy/_core/include -I/root/miniforge3/envs/test/include/python3.10 -c src/init/errorno.c -o build/temp.linux-x86_64-cpython-310/src/init/errorno.o" failed with 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
Failed to build pygsl
ERROR: Could not build wheels for pygsl, which is required to install pyproject.toml-based projects
Windows 11 Pro 64bit, Python 3.11, failed to install:
C:\Users\User\Downloads>py -3.11 -m pip install -U pygsl
Collecting pygsl
Downloading pygsl-2.3.3.tar.gz (1.1 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.1/1.1 MB 4.9 MB/s eta 0:00:00
Installing build dependencies ... done
Getting requirements to build wheel ... error
error: subprocess-exited-with-error
× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> [36 lines of output]
Traceback (most recent call last):
File "C:\Users\User\AppData\Local\Temp\pip-install-di80nit0\pygsl_2192209ed4144c878b81d4a94329bf26\gsl_dist\gsl_Location.py", line 141, in init
import gsl_site
ModuleNotFoundError: No module named 'gsl_site'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Python311\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 353, in <module>
main()
File "C:\Python311\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 335, in main
json_out['return_val'] = hook(**hook_input['kwargs'])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Python311\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 118, in get_requires_for_build_wheel
return hook(config_settings)
^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\User\AppData\Local\Temp\pip-build-env-87dc8xng\overlay\Lib\site-packages\setuptools\build_meta.py", line 325, in get_requires_for_build_wheel
return self._get_build_requires(config_settings, requirements=['wheel'])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\User\AppData\Local\Temp\pip-build-env-87dc8xng\overlay\Lib\site-packages\setuptools\build_meta.py", line 295, in _get_build_requires
self.run_setup()
File "C:\Users\User\AppData\Local\Temp\pip-build-env-87dc8xng\overlay\Lib\site-packages\setuptools\build_meta.py", line 311, in run_setup
exec(code, locals())
File "<string>", line 99, in <module>
File "C:\Users\User\AppData\Local\Temp\pip-install-di80nit0\pygsl_2192209ed4144c878b81d4a94329bf26\gsl_dist\gsl_Extension.py", line 22, in <module>
from gsl_Location import gsl_Location
File "C:\Users\User\AppData\Local\Temp\pip-install-di80nit0\pygsl_2192209ed4144c878b81d4a94329bf26\gsl_dist\gsl_Location.py", line 160, in <module>
gsl_Location = _gsl_Location_file()
^^^^^^^^^^^^^^^^^^^^
File "C:\Users\User\AppData\Local\Temp\pip-install-di80nit0\pygsl_2192209ed4144c878b81d4a94329bf26\gsl_dist\gsl_Location.py", line 148, in __init__
raise DistutilsExecError(msg % des)
distutils.errors.DistutilsExecError: I do not know how to run gsl-config
on this system. Therefore you must provide me with the information
where to find the GSL library. I could not import `gsl_site'.
Reason: No module named 'gsl_site'. Copy gsl_site_example.py to gsl_site.py.
Edit the variables in that file to reflect your installation.
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error
× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> See above for output.
note: This error originates from a subprocess, and is likely not a problem with pip.
C:\Users\User\Downloads>
python setup.py config
and
python setup.py build
are giving:
gsl-config: not found
First some notes on the new release (2.3.4):
pygsl-2.3.3.tar.gz
and now it is pygsl-v.2.3.4.tar.gz
(note the extra v.
).Now the main problem, when running pytest I get:
...
del _shortname
E NameError: name '_shortname' is not defined
=========================== short test summary info ============================
ERROR testing/tests/sf_test.py - NameError: name '_shortname' is not defined
ERROR testing/tests/test_airy_from_gsl_src.py - NameError: name '_shortname' ...
ERROR testing/tests/test_bessel_from_gsl_src.py - NameError: name '_shortname...
ERROR testing/tests/test_coulomb_from_gsl_src.py - NameError: name '_shortnam...
ERROR testing/tests/test_dilog_from_gsl_src.py - NameError: name '_shortname'...
ERROR testing/tests/test_gamma_from_gsl_src.py - NameError: name '_shortname'...
ERROR testing/tests/test_hermite_from_gsl_src.py - NameError: name '_shortnam...
ERROR testing/tests/test_hyperg_from_gsl_src.py - NameError: name '_shortname...
ERROR testing/tests/test_legendre_from_gsl_src.py - NameError: name '_shortna...
ERROR testing/tests/test_mathieu_from_gsl_src.py - NameError: name '_shortnam...
ERROR testing/tests/test_sf_from_gsl_src.py - NameError: name '_shortname' is...
!!!!!!!!!!!!!!!!!!! Interrupted: 11 errors during collection !!!!!!!!!!!!!!!!!!!
============================== 11 errors in 2.02s ==============================
So we have the same error repeated 11 times.
For example in testing/tests/sf_test.py
the variable _shortname
is defined inside the for cycle, since
from pygsl.testing import _ufuncs
is empty this will fail.
Now why do I get an empty import I have no idea. It worked in the pre-release.
I admit that the problem can be how I am calling pytest...
`Traceback (most recent call last):
File "E:\pygsl-2.3.3\gsl_dist\gsl_Location.py", line 141, in init
import gsl_site
ModuleNotFoundError: No module named 'gsl_site'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "E:\pygsl-2.3.3\setup.py", line 99, in
from gsl_Extension import gsl_Extension
File "E:\pygsl-2.3.3\gsl_dist\gsl_Extension.py", line 22, in
from gsl_Location import gsl_Location
File "E:\pygsl-2.3.3\gsl_dist\gsl_Location.py", line 160, in
gsl_Location = _gsl_Location_file()
File "E:\pygsl-2.3.3\gsl_dist\gsl_Location.py", line 148, in init
raise DistutilsExecError(msg % des)
distutils.errors.DistutilsExecError: I do not know how to run gsl-config
on this system. Therefore you must provide me with the information
where to find the GSL library. I could not import `gsl_site'.
Reason: No module named 'gsl_site'. Copy gsl_site_example.py to gsl_site.py.
Edit the variables in that file to reflect your installation.
(rcop) E:\pygsl-2.3.3>python setup.py install
Traceback (most recent call last):
File "E:\pygsl-2.3.3\gsl_dist\gsl_Location.py", line 141, in init
import gsl_site
ModuleNotFoundError: No module named 'gsl_site'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "E:\pygsl-2.3.3\setup.py", line 99, in
from gsl_Extension import gsl_Extension
File "E:\pygsl-2.3.3\gsl_dist\gsl_Extension.py", line 22, in
from gsl_Location import gsl_Location
File "E:\pygsl-2.3.3\gsl_dist\gsl_Location.py", line 160, in
gsl_Location = _gsl_Location_file()
File "E:\pygsl-2.3.3\gsl_dist\gsl_Location.py", line 148, in init
raise DistutilsExecError(msg % des)
distutils.errors.DistutilsExecError: I do not know how to run gsl-config
on this system. Therefore you must provide me with the information
where to find the GSL library. I could not import gsl_site'. Reason: No module named 'gsl_site'. Copy gsl_site_example.py to gsl_site.py. Edit the variables in that file to reflect your installation.
I tried to compile pygsl with python3.12 and got
python312 setup.py build
Traceback (most recent call last):
File "/giga/install/python312/pygsl-2.3.3/setup.py", line 99, in
from gsl_Extension import gsl_Extension
File "/giga/install/python312/pygsl-2.3.3/gsl_dist/gsl_Extension.py", line 19, in
import imp
ModuleNotFoundError: No module named 'imp'
After depreciating the modul imp.py has been removed in python3.12
Will there be any new version of pygsl? It's very useful.
In order to get python -m pip install pygsl
(as shown in README.rst) to work, I had to install swig first. A note about the swig dependency could be helpful there.
Hi,
I think a problem was introduced in this commit..
from abc import abstractmethod, abcmeta
abcmeta
does not exist and I'm guessing it should be replaced by ABCMeta
.
Thanks !
I noticed that pygsl is licensed under GPL 2.0 while the gsl library itself falls under GPL 3.0 is this intentional ?
I attempted to install pygsl on my mac. I followed the installation steps and at the end where i had to write in python include pygsl.sf it gave me an "no module named pygsl.sf". I know I am doing something wrong but cannot figure it out. It would be nice if anyone could help me.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.