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* .
Related
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.
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
So I've installed python via homebrow. When I do brew info python I get this:
python: stable 3.6.5 (bottled), devel 3.7.0rc1, HEAD
Interpreted, interactive, object-oriented programming language
https://www.python.org/
/usr/local/Cellar/python/3.6.5_1 (5,107 files, 103.0MB) *
Poured from bottle on 2018-06-18 at 10:15:49
From: https://github.com/Homebrew/homebrew-core/blob/master/Formula/python.rb
==> Dependencies
Build: pkg-config ✔, sphinx-doc ✘
Required: gdbm ✔, openssl ✔, readline ✔, sqlite ✔, xz ✔
Optional: tcl-tk ✘
==> Options
--with-tcl-tk
Use Homebrew's Tk instead of macOS Tk (has optional Cocoa and threads support)
--devel
Install development version 3.7.0rc1
--HEAD
Install HEAD version
==> Caveats
Python has been installed as
/usr/local/bin/python3
Unversioned symlinks `python`, `python-config`, `pip` etc. pointing to
`python3`, `python3-config`, `pip3` etc., respectively, have been installed into
/usr/local/opt/python/libexec/bin
If you need Homebrew's Python 2.7 run
brew install python#2
Pip, setuptools, and wheel have been installed. To update them run
pip3 install --upgrade pip setuptools wheel
You can install Python packages with
pip3 install <package>
They will install into the site-package directory
/usr/local/lib/python3.6/site-packages
See: https://docs.brew.sh/Homebrew-and-Python
I'm ultimately trying to do pip3 install numpy but when I do that, I get this message:
-bash: pip3: command not found
pip install numpy seems to point to the Apple default 2.7 python version:
Requirement already satisfied: numpy in /Library/Python/2.7/site-packages (1.14.5)
So the problem seems to be in my .bash_profile as which python gives /usr/bin/python.
Here's what that looks like:
export PATH=/usr/local/bin:$PATH
export PATH=/usr/local/Cellar/python/3.6.5_1/bin:$PATH
[[ -s "$HOME/.profile" ]] && source "$HOME/.profile" # Load the default .profile
export PATH=$PATH:/Users/thammond/Library/Android/sdk/platform-tools
###########
export PATH=/usr/local/Cellar/postgresql\#9.6/9.6.6/bin:$PATH
###########
export ANDROID_HOME=$HOME/Library/Android/sdk
export PATH=$PATH:$ANDROID_HOME/tools
export PATH=$PATH:$ANDROID_HOME/platform-tools
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*
I confirmed that /usr/local/ was listed at the top and also tried adding in export PATH=/usr/local/Cellar/python/3.6.5_1/bin:$PATH
But it's still finding the wrong python. Any ideas where I'm going wrong?
EDIT:
When I run python3 -m ensurepip --upgrade I see this:
Requirement already up-to-date: setuptools in ./Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages
Requirement already up-to-date: pip in ./Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages
When I run python3 -m ensurepip -vvv -U I get this:
Ignoring indexes: https://pypi.python.org/simple
0 location(s) to search for versions of setuptools:
Skipping link /var/folders/7d/xvqc5yxs10n6206lytrbs9wm0000gn/T/tmpk6_9t6c2 (from -f); not a file
Skipping link file:///private/var/folders/7d/xvqc5yxs10n6206lytrbs9wm0000gn/T/tmpk6_9t6c2/pip-9.0.3-py2.py3-none-any.whl; wrong project name (not setuptools)
Found link file:///private/var/folders/7d/xvqc5yxs10n6206lytrbs9wm0000gn/T/tmpk6_9t6c2/setuptools-39.0.1-py2.py3-none-any.whl, version: 39.0.1
Local files found: /private/var/folders/7d/xvqc5yxs10n6206lytrbs9wm0000gn/T/tmpk6_9t6c2/setuptools-39.0.1-py2.py3-none-any.whl
Installed version (39.2.0) is most up-to-date (past versions: 39.0.1)
Requirement already up-to-date: setuptools in ./Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages
0 location(s) to search for versions of pip:
Found link file:///private/var/folders/7d/xvqc5yxs10n6206lytrbs9wm0000gn/T/tmpk6_9t6c2/pip-9.0.3-py2.py3-none-any.whl, version: 9.0.3
Skipping link file:///private/var/folders/7d/xvqc5yxs10n6206lytrbs9wm0000gn/T/tmpk6_9t6c2/setuptools-39.0.1-py2.py3-none-any.whl; wrong project name (not pip)
Local files found: /private/var/folders/7d/xvqc5yxs10n6206lytrbs9wm0000gn/T/tmpk6_9t6c2/pip-9.0.3-py2.py3-none-any.whl
Installed version (10.0.1) is most up-to-date (past versions: 9.0.3)
Requirement already up-to-date: pip in ./Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages
Cleaning up...
When I look in /usr/local/Cellar/python/3.6.5_1/bin/ with finder I don't see a pip/pip3 file.
Did you try to invoke /usr/local/Cellar/python3/3.6.5_1/bin/pip3 ? If it works, it means pip installation has been successfuly completed and your bashfile will be wrong. However, the bashfile looks normal for me.
Did you confirm that there is pip3 in /usr/local/Cellar/python3/3.6.5_1/bin/?
If it does not exist, pip is not installed in the first place.
It seems to have the same problem with this page ("pip3 not installed with python 3.4.2 #33897").
The questioner of "pip3 not installed with python 3.4.2 #33897" have finaly solved it by removing /private/var/folders/hy/l_6wd1ps0nz835v4g41zhhtr0000gn/T/pip_build.
It may be because of Brew had failed to complete pip installation.
First, to bootstrap the pip installer, hit python3 -m ensurepip --upgrade and python -m ensurepip.
If it won't work, try to hit python3 -m ensurepip -vvv -U and tell what do it say.
I'm not really sure why it worked this time but just for kicks I decided to uninstall and reinstall python from homebrew again but this time it worked and pip3 installed correctly and works.
brew uninstall python3
brew install python3
now I can run pip3 install numpy --user
I've been searching the web for ways to solve this issue but nothing works.
I have a web server with CentOS 6.7 and I've successfully installed python 2.7.10 on it (it comes with version 2.6.6)
I followed up to step two in this site: https://cpaneltips.com/install-python-2-7-python-3-x-centos-cpanel/
I then installed virtualenv (using pip) and created another directory called "news"
Installed virtualenv and activated it so I have a python 2.7.10 environment. I ran "pip install scrapy"
But I have been getting this frustrating error:
Could not find a version that satisfies the requirement Twisted>=10.0.0 (from scrapy) (from versions: )
Some externally hosted files were ignored as access to them may be unreliable (use --allow-external Twisted to allow).
No matching distribution found for Twisted>=10.0.0 (from scrapy)
I then ran "pip install --allow-external scrapy scrapy"
still doesn't work... What am I missing?
wget https://pypi.python.org/packages/source/T/Twisted/Twisted14.0.0.tar.bz2#md5=9625c094e0a18da77faa4627b98c9815 --no-check-certificate
tar -vxjf Twisted-14.0.0.tar.bz2
cd Twisted-14.0.0
python setup.py install
pip install scrapy
It's clear you need twisted, you can firstly install twisted in your virtualenv:
pip install twisted
and then install scrapy:
pip install scrapy
This worked for me:
wget https://files.pythonhosted.org/packages/12/2a/e9e4fb2e6b2f7a75577e0614926819a472934b0b85f205ba5d5d2add54d0/Twisted-18.4.0.tar.bz2
tar -vxjf Twisted-18.4.0.tar.bz2
cd Twisted-18.4.0
python setup.py install
pip install scrapy
I am trying to install waferslim (A python port of the fitnesse slim server and protocols) into my python environment. Waferslim is in the Python package library PyPI, however when I try to install it using pip it doesn't work, I get a package not found error:
(test) C:\Python27\VirtualEnvs\test\Scripts>pip install waferslim
Downloading/unpacking waferslim
Could not find any downloads that satisfy the requirement waferslim
Cleaning up...
No distributions at all found for waferslim
But if I try installing it with easy_install, it is installed correctly. Why does this happen? Is there a way I can install it using Pip instead of easy_install? I wrote a requirements.txt file that holds all the dependencies for my project, but running pip install -r requirements.txt fails because of waferslim.