- Saved searches
- Use saved searches to filter your results more quickly
- [22.03] python3 detection fails on Ubuntu 22.04.1 in WSL #11887
- [22.03] python3 detection fails on Ubuntu 22.04.1 in WSL #11887
- Comments
- Describe the bug
- OpenWrt version
- OpenWrt target/subtarget
- Device
- Image kind
- Steps to reproduce
- Actual behaviour
- Expected behaviour
- Build dependency please install python 2 x
- Thread: Install python2 on ubuntu 23.04 ?!
- Install python2 on ubuntu 23.04 ?!
- Re: Install python2 on ubuntu 23.04 ?!
- Re: Install python2 on ubuntu 23.04 ?!
- Re: Install python2 on ubuntu 23.04 ?!
- Re: Install python2 on ubuntu 23.04 ?!
- Re: Install python2 on ubuntu 23.04 ?!
- Re: Install python2 on ubuntu 23.04 ?!
Saved searches
Use saved searches to filter your results more quickly
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session.
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
[22.03] python3 detection fails on Ubuntu 22.04.1 in WSL #11887
[22.03] python3 detection fails on Ubuntu 22.04.1 in WSL #11887
build/scripts/tools pull request/issues for build, scripts and tools related changes not a bug reported issue which is not considered as a bug release/22.03 pull request/issue targeted (also) for OpenWrt 22.03 release
Comments
Describe the bug
I need a openwrt plugin but i need compile myself,so I downloaded openwrt sdk and plugin source for compile.
But in my Ununtu 22.04.1 LTS, the error «Build dependency: Please install Python >= 3.5» occured.
I checked the python version, the Ubuntu already has a Python3.10 and I tried to install a extral Python 3.11,it is not work.
The a found the same error in github issue,It may be a bug. So i updated the lasted openwrt version in my device and download
the lasted openwrt sdk to my computer,Still not work.
Is the bug still exists? or my operation is incurrent.
OpenWrt version
OpenWrt target/subtarget
Device
Image kind
Official downloaded image
Steps to reproduce
Copy the plugin source to the subfloder «package» in Openwrt SDK
run «make» , «make V=1» , «make package/OpenAppFilter/oaf/compile V=1» .e.g (Comment: the plugin has muti ipk project,all ipk project is in «package/OpenAppFilter» folder.)
Actual behaviour
Checking ‘working-make’. ok.
Checking ‘case-sensitive-fs’. ok.
Checking ‘proper-umask’. ok.
Checking ‘gcc’. ok.
Checking ‘working-gcc’. ok.
Checking ‘g++’. ok.
Checking ‘working-g++’. ok.
Checking ‘ncurses’. ok.
Checking ‘perl-data-dumper’. ok.
Checking ‘perl-findbin’. ok.
Checking ‘perl-file-copy’. ok.
Checking ‘perl-file-compare’. ok.
Checking ‘perl-thread-queue’. ok.
Checking ‘tar’. ok.
Checking ‘find’. ok.
Checking ‘bash’. ok.
Checking ‘xargs’. ok.
Checking ‘patch’. ok.
Checking ‘diff’. ok.
Checking ‘cp’. ok.
Checking ‘seq’. ok.
Checking ‘awk’. ok.
Checking ‘grep’. ok.
Checking ‘egrep’. ok.
Checking ‘getopt’. ok.
Checking ‘stat’. ok.
Checking ‘unzip’. ok.
Checking ‘bzip2’. ok.
Checking ‘wget’. ok.
Checking ‘perl’. ok.
Checking ‘python2-cleanup’. ok.
Checking ‘python’. failed.
Checking ‘python3’. failed.
Checking ‘git’. ok.
Checking ‘file’. ok.
Checking ‘rsync’. ok.
Checking ‘which’. ok.
Checking ‘ldconfig-stub’. ok.
Build dependency: Please install Python >= 3.5
Build dependency: Please install Python >= 3.5
Prerequisite check failed. Use FORCE=1 to override.
make[2]: *** [/home/lzy/openwrtsdk/include/toplevel.mk:180: staging_dir/host/.prereq-build] Error 1
make[1]: *** [/home/lzy/openwrtsdk/include/toplevel.mk:77: prepare-tmpinfo] Error 2
make: *** [/home/lzy/openwrtsdk/include/toplevel.mk:221:world] 错误 2
Expected behaviour
Not a python missing error
Build dependency please install python 2 x
On Ubuntu 18.04.1 Compile OpenWrt Chaos Calmer encounter the following issues when recording it.
Build dependency: Please install the GNU C Compiler (gcc) Build dependency: Please reinstall the GNU C Compiler - it appears to be broken Build dependency: Please install the GNU C++ Compiler (g++) Build dependency: Please reinstall the GNU C++ Compiler - it appears to be broken Build dependency: Please install the Objective Caml compiler (ocaml-nox) v3.12 or later Build dependency: Please install ncurses. (Missing libncurses.so or ncurses.h) Build dependency: Please install zlib. (Missing libz.so or zlib.h) Build dependency: Please install the openssl library (with development headers) Build dependency: Please install Python 2.x Build dependency: Please install the Subversion client Build dependency: Please install Git (git-core) >= 1.6.5
If you have encountered Tip — Unable to locate package xxx
Please refer to
source into the domestic source
Build dependency: Please install the GNU C Compiler (gcc)
Build dependency: Please reinstall the GNU C Compiler — it appears to be broken
Build dependency: Please install the GNU C++ Compiler (g++)
Build dependency: Please reinstall the GNU C++ Compiler — it appears to be broken
Build dependency: Please install the Objective Caml compiler (ocaml-nox) v3.12 or later
$ sudo apt-get install ocaml
Note: The original source here with Ubuntu encounter an error message «Unable to locate package ocaml», replacing Ali cloud normal installation
Build dependency: Please install ncurses. (Missing libncurses.so or ncurses.h)
$ sudo apt-get install libncurses5-dev
Build dependency: Please install zlib. (Missing libz.so or zlib.h)
$ sudo apt-get install zlib1g-dev
Please install the openssl library (with development headers)
$ sudo apt-get install libssl-dev
Build dependency: Please install Python 2.x
$ sudo apt-get install python
Build dependency: Please install the Subversion client
$ sudo apt-get install subversion
Build dependency: Please install Git (git-core) >= 1.6.5
Note: If you have installed git but still receive this error message, please refer to two reasons, if not ignore two reasons.
View git version $ git --version git version 2.17.1
Because of the git version of the detection method is defective lead, OpenWRT already
2016-03-05 21:07 submission (4c80909fa141fe2921c62bd17b2b04153031df18) to fix the problem in
Solution Please refer to https://github.com/openwrt/openwrt/commit/4c80909fa141fe2921c62bd17b2b04153031df18
modified file include/prereq-build.mk Git version of the judgment in command.
I command judgment here is still git clone 2>&1 | grep – –recursive)),
to modify git –exec-path | xargs -I % – grep -q – –recursive %/git-submodule))
$(eval $(call SetupHostCommand,git,Please install Git (git-core) >= 1.7.12.2, \ - git clone 2>&1 | grep -- --recursive)) + git --exec-path | xargs -I % -- grep -q -- --recursive %/git-submodule))
Thread: Install python2 on ubuntu 23.04 ?!
Gee! These Aren’t Roasted!
Install python2 on ubuntu 23.04 ?!
~/$ sudo apt install python2Reading package lists. Done Building dependency tree. Done Reading state information. Done Package python2 is not available, but is referred to by another package. This may mean that the package is missing, has been obsoleted, or is only available from another source E: Package 'python2' has no installation candidate
eat, ride, sleep, repeat
Join Date Aug 2016 Location Wandering Beans 6,410 —> Beans Hidden! Distro Xubuntu Development Release
Re: Install python2 on ubuntu 23.04 ?!
sudo update-alternatives --config python There is 1 choice for the alternative python (providing /usr/bin/python). Selection Path Priority Status ------------------------------------------------------------ * 0 /usr/bin/python3 10 auto mode 1 /usr/bin/python3 10 manual mode Press to keep the current choice[*], or type selection number:
With realization of one’s own potential and self-confidence in one’s ability, one can build a better world.
Dalai Lama>>
Code Tags Arch Linux, openSuse Tumbleweed, Debian Unstable
Gee! These Aren’t Roasted!
Re: Install python2 on ubuntu 23.04 ?!
wget https://www.python.org/ftp/python/2.7.9/Python-2.7.9.tgz sudo tar xzf Python-2.7.9.tgz cd Python-2.7.9 sudo ./configure --enable-optimizations sudo make altinstall
python2.7 -V ~ Python 2.7.9 sudo ln -sfn '/usr/local/bin/python2.7' '/usr/bin/python2' sudo update-alternatives --install /usr/bin/python python /usr/bin/python2 1
sudo update-alternatives --config python * 0 /usr/bin/python3 2 auto mode 1 /usr/bin/python2 1 manual mode 2 /usr/bin/python3 2 manual mode Press to keep the current choice[*], or type selection number:
eat, ride, sleep, repeat
Join Date Aug 2016 Location Wandering Beans 6,410 —> Beans Hidden! Distro Xubuntu Development Release
Re: Install python2 on ubuntu 23.04 ?!
With realization of one’s own potential and self-confidence in one’s ability, one can build a better world.
Dalai Lama>>
Code Tags Arch Linux, openSuse Tumbleweed, Debian Unstable
Gee! These Aren’t Roasted!
Re: Install python2 on ubuntu 23.04 ?!
Modules & Layers
Re: Install python2 on ubuntu 23.04 ?!
Originally Posted by fairbird
Every things are fine . No more problems after my steps here
https://ubuntuforums.org/showthread. 7#post14140057
The correct verbiage would be: «No problems yet. «
1fallen was just being very kind. Linux Distributions are built around many Python Scripts for it’s framework and foundation. It’s taken over 4 years to convert from Python2 to Python3 and make that work. There are deep ingrained differences between the two, where things are just not going to work with Python2 being the primary version. (There is not longer a capability layer present either.)
Remember the steps you took and keep a record of any dependencies that it brought in with what you did. Because what you did, broke your system. If you cannot back off the changes, you will end of having to reinstall your OS, like many others who have done that,and had to try to recover from that. You are not the first to try or do this. You don’t see that there is a problem yet, but here is. and it is functionally broken.
Say what you will. Good luck.
Ubuntu addict and loving it
Re: Install python2 on ubuntu 23.04 ?!
Originally Posted by MAFoElffen
The correct verbiage would be: «No problems yet. «
1fallen was just being very kind. Linux Distributions are built around many Python Scripts for it’s framework and foundation. It’s taken over 4 years to convert from Python2 to Python3 and make that work. There are deep ingrained differences between the two, where things are just not going to work with Python2 being the primary version. (There is not longer a capability layer present either.)
Remember the steps you took and keep a record of any dependencies that it brought in with what you did. Because what you did, broke your system. If you cannot back off the changes, you will end of having to reinstall your OS, like many others who have done that,and had to try to recover from that. You are not the first to try or do this. You don’t see that there is a problem yet, but here is. and it is functionally broken.
Say what you will. Good luck.
Therefore, I suggest installing alternative versions of python in a separate environment in $HOME instead of using update-alternatives to mess with system python. In fact I use a separate version of python for development and my own projects even when the version is the same as the system’s and I never use apt to install python modules, instead I use pip which allows me to upgrade or downgrade modules easily (advice like «sudo apt install python3-numpy» makes me cringe unless it is a dependency for some other packages installed with apt)
I use a script called python310.conf to invoke python 3.10.9 in Ubuntu 22.04.
Python is installed in $HOME/opt/python310.
I think OP can modify it in a trivial way for his python2 installation
export PREFIX=/home/mb/opt/python310 export HOME=$PREFIX #optional, I want different profile for browser in order to use jupyter notebook export PYTHONHOME=$PREFIX export PATH=$PYTHONHOME/bin:$PATH export LD_LIBRARY_PATH=$PYTHONHOME/lib:$PYTHONHOME/lib/x86_64-linux-gnu:$LD_LIBRARY_PATH export PKG_CONFIG_PATH=$PREFIX/lib/pkgconfig:$PKG_CONFIG_PATH export PYTHONUSERBASE=$PYTHONHOME export PYTHONPATH=$PYTHONHOME/lib/python3.10/site-packages
To invoke python just source the script first in terminal
source /path/to/python310.conf
(obviously, don’t put this in .bashrc or .profile)
Maybe some of these are not necessary, or maybe you need to add more.
Most people use conda or pyenv to install separate python but I don’t like either way as conda installs a lot of junks I either don’t need or have already installed system wide and create unnecessary dependency issues and pyenv can only create python virtual environment of the same mayor version (so in 22.04 you can’t make pyenv for python 3.8 or python 3.11, but my method works) In OP cases neither would work as python2 is no longer supported by conda.