-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
Python2.7: bad install directory or PYTHONPATH (does not support .pth files) #616
Comments
You need to override PYTHONPATH in your Makefile to That You can check these files for example(s): |
Actually, if I think about it, I could try to add it in Will try it now. |
I just looked a bit closer to the code
I recall now that I had to create that dir, so that the Python distutils would be able to install the packages there (where the PYTHONPATH var points to). |
Shouldn't it by created once python itself is compiled? |
Thx for your replies. It would be the most convenient if we could create that dir via any Makefile so that no manual intervention is needed. |
Well, that folder is per-package. From @enigmagroup's output it's not Python that's failing, but rather Cython, which is something else. @enigmagroup : could you show me the Makefile you're using ? |
umm, which Makefile exactly? |
The Cython Makefile. |
Well then. Let's try to get this in the new packages. |
Cython itself compiles: |
I see just wondering (feel free to ignore), couldn't you set PYTHONPATH in python-support.mk and create the directory at the beginning of Build/Compile/PyMod? |
@sbyx : yep, I could do that; was thinking of something like that now |
Uh oh. I just found out that it's not "cython" that fails to compile, but "python-cython" - which is a package I had created in my repo. https://github.com/enigmagroup/enigmabox-openwrt/blob/master/python-cython/Makefile Sorry for the noise! So now all I have to do is to create that directory in my Makefile? I'll try it out right now. |
Ok, so far, it compiles. I found a Makefile that works, from an OpenWRT repo that has also a lot of Python3 stuff in it (https://gitorious.org/openwrt-cybjit/python3/commit/8eaacb12797787f4ffd629f8353a56d37b2613f0) The reason I created a separate python-cython was because I needed a fair recent version of cython, 0.20.2 at the time of creation. I guess it was a dependency for beanstalkc or django. |
Requirements made slightly more complete
This error happens when trying to build python2.7 with the most recent repo + package feeds:
( export PYTHONPATH="/home/x/openwrt-banana-mostrecent/staging_dir/target-arm_cortex-a8+vfpv3_uClibc-0.9.33.2_eabi/usr/lib/python2.7:/home/x/openwrt-banana-mostrecent/staging_dir/target-arm_cortex-a8+vfpv3_uClibc-0.9.33.2_eabi//usr/lib/python2.7/site-packages"; export PYTHONOPTIMIZE=""; export PYTHONDONTWRITEBYTECODE=1; cd /home/x/openwrt-banana-mostrecent/build_dir/host/Cython-0.20.2/; CFLAGS="-O2 -I/home/x/openwrt-banana-mostrecent/staging_dir/host/include -I/home/x/openwrt-banana-mostrecent/staging_dir/host/usr/include" CPPFLAGS="-I/home/x/openwrt-banana-mostrecent/staging_dir/host/include -I/home/x/openwrt-banana-mostrecent/staging_dir/host/usr/include" LDFLAGS="-L/home/x/openwrt-banana-mostrecent/staging_dir/host/lib -L/home/x/openwrt-banana-mostrecent/staging_dir/host/usr/lib" /home/x/openwrt-banana-mostrecent/staging_dir/host/bin/python2 ./setup.py install --no-cython-compile --prefix="/home/x/openwrt-banana-mostrecent/staging_dir/host/usr" ; )
running install
Checking .pth file support in /home/x/openwrt-banana-mostrecent/staging_dir/host/usr/lib/python2.7/site-packages/
/home/x/openwrt-banana-mostrecent/staging_dir/host/bin/python2 -E -c pass
TEST FAILED: /home/x/openwrt-banana-mostrecent/staging_dir/host/usr/lib/python2.7/site-packages/ does NOT support .pth files
error: bad install directory or PYTHONPATH
You are attempting to install a package to a directory that is not
on PYTHONPATH and which Python does not read ".pth" files from. The
installation directory you specified (via --install-dir, --prefix, or
the distutils default setting) was:
and your PYTHONPATH environment variable currently contains:
Here are some of your options for correcting the problem:
You can choose a different installation directory, i.e., one that is
on PYTHONPATH or supports .pth files
You can add the installation directory to the PYTHONPATH environment
variable. (It must then also be on PYTHONPATH whenever you run
Python and want to use the package(s) you are installing.)
You can set up the installation directory to support ".pth" files by
using one of the approaches described here:
https://pythonhosted.org/setuptools/easy_install.html#custom-installation-locations
Please make the appropriate changes for your system and try again.
make[3]: *** [/home/x/openwrt-banana-mostrecent/build_dir/host/Cython-0.20.2/.built] Error 1
make[3]: Leaving directory
/home/x/openwrt-banana-mostrecent/feeds/enigmabox/python-cython' make[2]: *** [package/feeds/enigmabox/python-cython/host/compile] Error 2 make[2]: Leaving directory
/home/x/openwrt-banana-mostrecent'make[1]: *** [/home/x/openwrt-banana-mostrecent/staging_dir/target-arm_cortex-a8+vfpv3_uClibc-0.9.33.2_eabi/stamp/.package_compile] Error 2
make[1]: Leaving directory `/home/x/openwrt-banana-mostrecent'
make: *** [world] Error 2
The text was updated successfully, but these errors were encountered: