I am trying to install wxPython 2.8 on Ubuntu 18.04 system. But it is failing with below error :
$ sudo apt install python-wxgtk2.8
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package python-wxgtk2.8 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 'python-wxgtk2.8' has no installation candidate
Let me know how to resolve above error so that I can install wxPython 2.8
Since there are various options for distro and wx port (GTK2 or GTK3) then the files can not all be located in the same folder for easy access by pip. This simply just means that you'll need to drill down a little further to find the URL to give to pip. For example, to get the GTK3 wxPython builds for Ubuntu 18.04 (and 16.10, LinuxMint 18, and probably others) you can use a pip command like this:
pip install -U \
-f https://extras.wxpython.org/wxPython4/extras/linux/gtk3/ubuntu-16.04 \
wxPython
Of course you can always download the wheel file yourself and then use pip to install your local copy of the file.
From https://extras.wxpython.org/wxPython4/extras/
Just open your terminal and do :
URL=https://extras.wxpython.org/wxPython4/extras/linux/gtk3/ubuntu-18.04
pip install -U -f $URL wxPython
This worked for me !
This might help you out:
sudo echo "deb http://archive.ubuntu.com/ubuntu trusty main universe" | sudo tee /etc/apt/sources.list.d/wily-copies.list
sudo apt-get update
sudo apt-get install python-wxgtk2.8
I used this in an xterminal to include trusty repository in synaptic.
echo "deb http://archive.ubuntu.com/ubuntu trusty main universe" | sudo tee /etc/apt/sources.list.d/wily-copies.list
after this in Synaptic-packagemanager reloaded the repository and then I installed it.
Be sure to un-select the repository (under "Settings" "Repositories" "Additional repositories") so you won't install obsolete software from this old repository
After waiting long enough the process was complete and I got wxPython 4 installed.
run
sudo apt install make gcc libgtk-3-dev libwebkitgtk-dev libwebkitgtk-3.0-dev libgstreamer-gl1.0-0 freeglut3 freeglut3-dev python-gst-1.0 python3-gst-1.0 libglib2.0-dev ubuntu-restricted-extras libgstreamer-plugins-base1.0-dev
sudo pip install wxpython
wait for a while for it to install
after completion, you will see this message.
The directory '/home/user-ii-6/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/home/user-ii-6/.cache/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Collecting wxpython
Downloading https://files.pythonhosted.org/packages/dd/31/bd55ab40e406a026a7fda0bb5eb61f466682544ae91ac26267c750f5e618/wxPython-4.0.3.tar.gz (68.5MB)
100% |\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588| 68.5MB 929kB/s
Requirement already satisfied: six in ./.local/lib/python2.7/site-packages (from wxpython) (1.11.0)
Requirement already satisfied: PyPubSub in ./.local/lib/python2.7/site-packages (from wxpython) (4.0.0)
Requirement already satisfied: typing in ./.local/lib/python2.7/site-packages (from PyPubSub->wxpython) (3.6.6)
Installing collected packages: wxpython
Running setup.py install for wxpython ... done
Successfully installed wxpython-4.0.3
Related
I've been trying to install Pybossa and I've been trying to follow these steps from the documentation, and this link too (which they're the same).
when it comes to using this command pip install -r requirements.txt it keeps running some installations and then and error occurred :
ERROR: Could not find a version that satisfies the requirement jeepney==0.4 (from pybossa==3.1.2->-r requirements.t
xt (line 3)) (from versions: none)
ERROR: No matching distribution found for jeepney==0.4 (from pybossa==3.1.2->-r requirements.txt (line 3))
this is what's inside requirements.txt :
I don't know why this is happening as i'm following the documentation .. so i'd glade if anyone helped me.
I'm using :
Ubuntu server 18.04
python 2.7
virtualenv
PostgreSQL
You are better off going for latest python 3. python 2 had its eol early this year. For new approaches it would be a dead end.
I am on 16.04, but hope you can do the turn likewise
make use of native venv option, don't use virtualenv any more
during the setup you likely will get compilation errors. Those are due to the fact not having a fully equipped build machine. It's very likely that you need to apt-get install more or less dev packages to your system. It depends how deep you had done gcc compilation in the past. For me it was:
sudo apt-get install python3-dev
sudo apt-get install libsasl2-dev libldap2-dev libssl-devm
whenever you encounter compilation errors like this:
Modules/constants.h:7:18: fatal error: lber.h: No such file or directory
compilation terminated.
you need to find the appropriate dev lib and add it to the system with apt-get like mentioned above by easiest looking the error up in your favorite internet search engine
Steps for the setup of pybossa
python3 -m venv ./pb_env
. ./pb_env/bin/activate
pip install --upgrade pip
mkdir pb #shorthand for pybossa
cd pb
git clone --recursive https://github.com/Scifabric/pybossa
cd pybossa/
pip install -r requirements.txt
feel free to ask again if you still get stuck.
All versions of jeepney starting with 0.1 (released in 2017) requires Python >= 3.5.
I am trying to install ansible on CentOS 8 but no success, After searching google i did following steps
yum install python3-pip
pip3 install ansible
but it shows following output and no ansible avaiable
[root#okd1 ~]# pip3 install ansible
WARNING: Running pip install with root privileges is generally not a good idea. Try `pip3 install --user` instead.
Requirement already satisfied: ansible in ./.local/lib/python3.6/site-packages
Requirement already satisfied: jinja2 in ./.local/lib/python3.6/site-packages (from ansible)
Requirement already satisfied: PyYAML in /usr/lib64/python3.6/site-packages (from ansible)
Requirement already satisfied: cryptography in /usr/lib64/python3.6/site-packages (from ansible)
Requirement already satisfied: MarkupSafe>=0.23 in ./.local/lib/python3.6/site-packages (from jinja2->ansible)
Requirement already satisfied: idna>=2.1 in /usr/lib/python3.6/site-packages (from cryptography->ansible)
Requirement already satisfied: asn1crypto>=0.21.0 in /usr/lib/python3.6/site-packages (from cryptography->ansible)
Requirement already satisfied: six>=1.4.1 in /usr/lib/python3.6/site-packages (from cryptography->ansible)
Requirement already satisfied: cffi!=1.11.3,>=1.7 in /usr/lib64/python3.6/site-packages (from cryptography->ansible)
Requirement already satisfied: pycparser in /usr/lib/python3.6/site-packages (from cffi!=1.11.3,>=1.7->cryptography->ansible)
i tried to manually download and install but still no success
curl -o ansible.rpm https://releases.ansible.com/ansible/rpm/release/epel-7-x86_64/ansible-2.8.5-1.el7.ans.noarch.rpm
[root#okd1 ~]# yum install ansible.rpm
Last metadata expiration check: 0:09:14 ago on Wed 25 Sep 2019 05:39:22 PM EDT.
Error:
Problem: conflicting requests
- nothing provides python-setuptools needed by ansible-2.8.5-1.el7.ans.noarch
- nothing provides python-six needed by ansible-2.8.5-1.el7.ans.noarch
- nothing provides PyYAML needed by ansible-2.8.5-1.el7.ans.noarch
- nothing provides python-jinja2 needed by ansible-2.8.5-1.el7.ans.noarch
- nothing provides python-paramiko needed by ansible-2.8.5-1.el7.ans.noarch
- nothing provides python2-cryptography needed by ansible-2.8.5-1.el7.ans.noarch
- nothing provides sshpass needed by ansible-2.8.5-1.el7.ans.noarch
(try to add '--skip-broken' to skip uninstallable packages or '--nobest' to use not only best candidate packages)
then tried to deploy these packages but no success
[root#okd1 ~]# pip3 install python-setuptools
WARNING: Running pip install with root privileges is generally not a good idea. Try `pip3 install --user` instead.
Collecting python-setuptools
Could not find a version that satisfies the requirement python-setuptools (from versions: )
No matching distribution found for python-setuptools
[root#okd1 ~]#
[root#okd1 ~]# pip2 install python-setuptools
WARNING: Running pip install with root privileges is generally not a good idea. Try `pip2 install --user` instead.
Collecting python-setuptools
Could not find a version that satisfies the requirement python-setuptools (from versions: )
No matching distribution found for python-setuptools
You see one warning, which you should take very seriously if you don't want to destroy files, that were installed via yum packages. which is
Running pip install with root privileges is generally not a good idea.
Try pip3 install --user instead.
I suggest to try using a virtualenv. Using a virtualenv reduces the probability to destroy an existing setup and allows you to have different package versions per virtualenv. Just do not forget to activate your virtualenv before pip installing into it.
Unfortunately Ansible has (had at least when I used it last time) a small issue, that it will not be able to install packages if you use a virtualenv which does not include system site packages, so I'm not 100% sure, you will be successful.
I try to walk you through following:
1.) install virtualenv (either with yum or with pip install, but in order to not destroy anything in your existing setup you'd use pip install with the --user option)
2.) create a virtualenv for python3 with system site packages enabled as you will have issues with ansible and package installation otherwise
3.) enable your virtualenv (Do not forget this!)
4.) Check that you really enabled your virtualenv
5.) pip install ansible with the -U option
Try out ansible and specify the path to the python executable of your virtualenv in with the ansible_python_interpreter setting of ansible ( https://docs.ansible.com/ansible/latest/reference_appendices/interpreter_discovery.html )
Collecting python-setuptools
You might try to use a virtualenv in order to avoid conflicts with existing packages.
You might try something like:
sudo pip install --user virtualenv # or install virtualenv with yum if you know the package name.
then
virtualenv -p $(which python3) /root/ansiblevenv --system-site-packages
now activate the virutalenv
. /root/ansiblevenv/bin/activate # do not forget the space between the . and the /
Now check, that the active python is the one of the virtualenv
type python
you should see /root/ansiblevenv/bin/python instead if 'usr/bin/python' if not the virtualenv is not enabled properly
Now update pip (just in case)
pip install -U pip
and now try to install ansible
pip install -U ansible
You can also use the below steps to install Ansible on CentOS 8.
Step 1: Installation of EPEL repository
Ansible is not available in the default repository. So, to install it, we have to enable the EPEL repository. Firstly, we are going to install epel-release. Use the below command to install it.
sudo dnf -y install epel-release
Note: you can also use yum command instead of dnf
Step 2: Installing Ansible on CentOS 8
let’s install Ansible. Use the below command for this installation.
sudo dnf -y install ansible
Once the installation is completed, then use the below command to verify the version.
ansible --version
That's it. But you can read more about ansible installation on CentOS8 related commands for managed node and other details. You can visit my blog post for Ansible. You can use the URL below.
How to install and configure Ansible on CentOS 8
I need to update offline a library in Python.
I have downloaded the library with pip download and then I try to update the library with the command:
pip install --no-index --user --find-links /tmp/pip/ --upgrade Werkzeug==0.15.5
which gives:
Ignoring indexes: https://...
Collecting Werkzeug==0.15.5
Installing collected packages: Werkzeug
Successfully installed Werkzeug-0.11.15
and then the library stays in the same version!
pip freeze | grep Wer
Werkzeug==0.11.15
Any ideas why this happens?
UPDATE: After the comment from #hoefling I rerun with the -vvv option and this is what I got:
pip install --no-index --user --find-links /tmp/pip2/ -vvv Werkzeug==0.15.5
Ignoring indexes: https://pypi:pypi#..../simple/
Collecting Werkzeug==0.15.5
0 location(s) to search for versions of Werkzeug:
Skipping link /tmp/pip2/werk/ (from -f); not a file
Found link file:///tmp/pip2/werk/Werkzeug-0.15.5-py2.py3-none-any.whl, version:
0.15.5
Local files found: /tmp/pip2/werk/Werkzeug-0.15.5-py2.py3-none-any.whl
Using version 0.15.5 (newest of versions: 0.15.5)
Installing collected packages: Werkzeug
Successfully installed Werkzeug-0.11.15
Cleaning up...
Try this command:
pip install Werkzeug-0.15.5.tar.gz
and the result must be like this:
Processing ./Werkzeug-0.15.5.tar.gz
Installing collected packages: Werkzeug
Running setup.py install for Werkzeug ... done
Successfully installed Werkzeug-0.15.5
This behaviour can happen because pip by default works with system Python which is located in /usr/bin/ on Linux. When installing the package, by giving Python --user flag your package is installed in your user's version of Python, probably located somewhere in ~/.local/.
To solve the problem you can install the package to your system Python, which is generally not recommended without --user flag. Another option is to use virtual environments and have the distribution that is made specifically for your project. Currently the recommended way is using venv.
$ python -m venv env
$ source env/bin/activate
(env) $ pip install ... (packages you need to install without --user flag)
(env) $ pip freeze
# should give you the packages you installed
This can help you not only with this example, but it can always keep your system Python installation clean and if you mess something up, you will only mess the environment you are having for specific project.
Whenever I try to import soundfile I get the error
ImportError: No module named soundfile
I installed pysoundfile seemingly without trouble:
$ sudo pip install pysoundfile
The directory '/Users/theonlygusti/Library/Caches/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/Users/theonlygusti/Library/Caches/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Collecting pysoundfile
Downloading PySoundFile-0.9.0.post1-py2.py3.cp26.cp27.cp32.cp33.cp34.cp35.cp36.pp27.pp32.pp33-none-macosx_10_5_x86_64.macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.whl (573kB)
100% |████████████████████████████████| 573kB 430kB/s
Requirement already satisfied: cffi>=0.6 in /Library/Python/2.7/site-packages (from pysoundfile)
Requirement already satisfied: pycparser in /Library/Python/2.7/site-packages (from cffi>=0.6->pysoundfile)
Installing collected packages: pysoundfile
Successfully installed pysoundfile-0.9.0.post1
so what's causing this problem?
Check if it is installed in a test environment
Example Ways
$ pip install virtualenv
$ python -m virtualenv venv
$ source venv/bin/activate
$ pip install pysoundfile
$ python
>>> import soundfile
PySoundFile depends on the Python packages CFFI and NumPy, and the system library libsndfile.
To install the Python dependencies, I recommend using the Anaconda distribution of Python 3.
This will come with all dependencies pre-installed. To install the dependencies manually, you can use the conda package manager, which will install all dependencies using conda install cffi numpy (conda is also available independently of Anaconda with pip install conda).
With CFFI and NumPy installed, you can use pip install pysoundfile to download and install the latest release of PySoundFile. On Windows and OS X, this will also install the library libsndfile. On Linux, you need to install libsndfile using your distribution's package manager, for example sudo apt-get install libsndfile1.
I had the same problem, I guess the problem is with python versions. When I tried with Python 3.5.2
python3 file_name.py
ImportError: No module named 'soundfile'
Instead, I tried the same with Python 2.7.12
python file_name.py
It successfully imported it!
For Google Colab Research
copy paste this
!pip install soundfile
& then import it
import soundfile
Right now Im using OS X Yosemite and trying to install in my virtuaenv few packages via pip:
relrin at MacBook-Relrin in ~
=> cd code/Helenae/
relrin at MacBook-Relrin in ~/code/Helenae
=> source bin/activate
relrin at MacBook-Relrin in ~/code/Helenae workon code
=> pip install wxPython wxPython-common
Downloading/unpacking wxPython
Could not find any downloads that satisfy the requirement wxPython
Some externally hosted files were ignored (use --allow-external wxPython to allow).
Cleaning up...
No distributions at all found for wxPython
Storing debug log for failure in /Users/savicvalera/.pip/pip.log
relrin at MacBook-Relrin in ~/code/Helenae exited 1 workon code
=> pip install --allow-external wxPython wxPython-common
Downloading/unpacking wxPython-common
Could not find any downloads that satisfy the requirement wxPython-common
Some externally hosted files were ignored (use --allow-external wxPython-common to allow).
Cleaning up...
No distributions at all found for wxPython-common
Storing debug log for failure in /Users/savicvalera/.pip/pip.log
Few minutes ago trying install via brew:
brew install wxPython
But installed not in virtualenv, installed in the main user directory.
How can I fix this? Cause wxPyWiki doesn't working right now, and i can't look at docs, how to use virtualenv and wxPython.
Just use this:
1) Install via brew:
brew install python --framework
brew install wxPython
2) Make virtualenv when you want
3) Go to your site-packages directory in your virtualenv and add symbol links:
cd <there your path to lib/python2.7/site-packages/ in virtualenv>
ln -s /usr/local/lib/python2.7/site-packages/wx* .