Open andersk opened 6 years ago
That's likely related to (not) updating the setup hook.
If you mean pkgs/development/interpreters/python/setup-hook.sh
, I don’t think that’s involved, as none of DETERMINISTIC_BUILD
, PYTHONHASHSEED
, nor PYTHONNOUSERSITE
are set in either the non-working nix-shell --pure -p 'pypy.withPackages (ps: [ps.setuptools])'
or the working nix-shell --pure -p 'python.withPackages (ps: [ps.setuptools])'
.
For now, consider using pythonInterpreters.pypy_prebuilt
or pythonInterpreters.pypy3_prebuilt
. These use patchelf
ed prebuilt binaries. I am quite sure these work. Unfortunately, fixing the from source builds always takes a lot of time. Note that these prebuilt ones can be used to speed up the building/translation of the other ones.
@FRidh Same problem with the prebuilt versions.
$ nix-shell --pure -p 'pythonInterpreters.pypy27_prebuilt.withPackages (ps: [ps.setuptools])' --run 'pypy -c "import setuptools"'
/nix/store/wciajzl7c5r76j32l8aj265bw7pdrqwf-pypy_prebuilt-6.0.0/bin/pypy: /nix/store/kimqdijh6r0p8d6if8xacnijl2y4ngw5-openssl-1.0.2q/lib/libssl.so.1.0.0: no version information available (required by /nix/store/wciajzl7c5r76j32l8aj265bw7pdrqwf-pypy_prebuilt-6.0.0/lib/libpypy-c.so)
/nix/store/wciajzl7c5r76j32l8aj265bw7pdrqwf-pypy_prebuilt-6.0.0/bin/pypy: /nix/store/kimqdijh6r0p8d6if8xacnijl2y4ngw5-openssl-1.0.2q/lib/libssl.so.1.0.0: no version information available (required by /nix/store/wciajzl7c5r76j32l8aj265bw7pdrqwf-pypy_prebuilt-6.0.0/lib/libpypy-c.so)
/nix/store/wciajzl7c5r76j32l8aj265bw7pdrqwf-pypy_prebuilt-6.0.0/bin/pypy: /nix/store/kimqdijh6r0p8d6if8xacnijl2y4ngw5-openssl-1.0.2q/lib/libcrypto.so.1.0.0: no version information available (required by /nix/store/wciajzl7c5r76j32l8aj265bw7pdrqwf-pypy_prebuilt-6.0.0/lib/libpypy-c.so)
Traceback (most recent call last):
File "<module>", line 1, in <module>
ImportError: No module named setuptools
Let's fix those first then.
Looks like pypy
doesn't support PYTHONHOME
. It's not documented, and setting it has no effect on sys.prefix
or sys.exec_prefix
. Also, the site-packages
folder that is used when building packages is hardcoded at build-time it seems, which is pretty annoying. I think it would be good if pypy's sysconfig was more like that of cpython. However, during runtime, the site-packages
folder on sys.path
is elsewhere.
PyPy's sourcecode indicates in comments that PYTHONHOME
is not supported.
good that we're not using PYTHONHOME
anymore but NIX_PYTHONPATH
;-)
The latter is implemented in a sitecustomize.py
The prebuilt ones function with Nixpkgs at f2c619fae8e2b82cde03c91bad45cf7f30b4841a:
$ nix run "(import ./. {}).pythonInterpreters.pypy36_prebuilt.withPackages(ps: with ps; [ pytest ])" --command "pytest"
Thank you for your contributions.
This has been automatically marked as stale because it has had no activity for 180 days.
If this is still important to you, we ask that you leave a comment below. Your comment can be as simple as "still important to me". This lets people see that at least one person still cares about this. Someone will have to do this at most twice a year if there is no other activity.
Here are suggestions that might help resolve this more quickly:
Still an issue.
I've just encountered this problem, too. Is anyone looking into it any more?
Is any work on this being done? I'm currently working around this problem by manually setting PYTHONPATH, e.g.:
PYTHONPATH=/nix/store/z5c5hfmhglwm8gchs1qy00ghafrp3r7w-pypy2.7-purepng-0.2.0/site-packages/: pypy script.py
This is far from ideal, as it's rather difficult to find the site-packages paths for this instance of pypy.withPackages
that was built.
Issue description
The
pypy
from, e.g.,pypy.withPackages (ps: [ps.setuptools])
can’timport setuptools
. Same for every other package I’ve tried. (Split off from #34066.)Steps to reproduce
Technical details
"x86_64-linux"
Linux 4.14.34, NixOS, 18.03.132083.06c576b0525 (Impala)
yes
yes
nix-env (Nix) 2.0
"nixos-18.03"
/nix/var/nix/profiles/per-user/root/channels/nixos/nixpkgs