I was making a QSS Theme Preview Program in PyQt 5. But, It suddenly stoppped working:
Traceback (most recent call last):
File "core.py", line 1, in <module>
from PyQt5.QtCore import *
ImportError: /usr/local/lib/python3.5/dist-packages/PyQt5/QtCore.so: undefined symbol: PySlice_AdjustIndices
I removed and re-installed qt5-default, python3-pyqt5, and python3-sip, but the error still occurs.
I am using Lubuntu 16.04 LTS (Xenial Xerus) On An Acer Chromebook R11 C738T using Crouton and Python 3.5.1-3 and PyQt 5.11.2. (I'm pretty sure that the version isn't the problem; other people had the same problem with different Python and PyQt versions)
P.S. Some people say that I need Python 3.6+, but when I run sudo apt install python3, apt says python3 is already the newest version (3.5.1-3). Plus, I get error when I try to build it myself.
I had the same problem, I fixed it by upgrading to python 3.6, sorry I can't dig deeper.
I put the steps to update the python from 3.5 to 3.6, in my case I work in Linux mint, but the steps should be the same.
First the installation.
sudo add-apt-repository ppa:jonathonf/python-3.6
sudo apt update
sudo apt-get install python3.6
Now the configuration (To make the system take version 3.6 by default)
!!!WARNING, depending on the version of Linux|distribution, system problems may be caused if you make default another python version!!!
sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.5 1
sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.6 2
update-alternatives --list python3
sudo update-alternatives --config python3
Then install the pip3 again
wget https://bootstrap.pypa.io/get-pip.py
sudo python3 get-pip.py
I hope it helps you, I'm sorry I can't tell you the cause of the problem, I hope someone tells us, for now it seems to be a PyQt5 bug with this version.
Anyway, good luck.
Related
I went to do some python leetcode on a personal repo and after I upgraded my Kubuntu to 22.04 I realized the current venv wasn't working.
I had figured I would need to recreate the venv.
Installed python3.10-venv but I cant source and activate it.
In fact venv/bin/activate doesn't exist anymore.
The folder only contains three files
python python3 python3.10
I had tried but no dice
source venv/bin/python3.10
So naturally source venv/bin/activate doesn't work. Ideas?
I've installed Ubuntu 22.0.4 and I've had the same problem as yours and I solved that problem in this way.
install venv:
sudo apt-get update
sudo apt-get install python3-virtualenv
Create venv:
virtualenv --python=/usr/bin/python3.10 (VENV-NAME)
python3.10 -m venv (VENV-NAME)
source (VENV-NAME)/bin/activate
check & update pip:
pip list
and update pip for example(in my pc):
(/home/amin/Desktop/prog/Django/moein/coffeinrider.com/Project/A/(VENV-NAME)/bin/python3.10 -m pip install --upgrade pip)
When trying to create a virtual env using venv for Python, a version of Python that is already installed system-wide must be used, but a version of the venv library from the system must also be used. These are two pre-requisites for setting up a virtual environment.
WARNING: I did this in a hurry because I needed it but please be warned: this may break your system Python with a result that applications that rely on it may break.
The problem I had, matching symptoms given here, seems to be that when trying to create a venv using Python 3.10.8, the venv module for Python 3.8.10 was being used.
So, given Python 3.8 and Python 3.10 are already installed using apt, first of all I uninstalled these packages:
sudo apt purge python3-venv python3.8-venv
sudo apt autoremove
Then I linked python3 to point to Python 3.10:
cd /usr/bin
sudo rm python3
sudo ln python3.10 python3
Then I installed the venv for Python3.10:
sudo apt install python3.10-venv
This now means creating a virtual environment for Python 3.8 doesn't work (because Python3.8 venv has just been removed). I'm not sure if there is a means to have them both working, and I haven't yet tried to just install python3.8-venv again and try them both, as I need my 3.10 environment working quickly, right now ;-). But it seems possible there has been some conflict introduced when following the usual upgrade route within Ubuntu 20.
However, venv for Python 3.10 should now work as expected:
$ python3 -m venv .venv
$ source .venv/bin/activate
(.venv) $ python -V
Python 3.10.8
(.venv) $ pip install --upgrade pip
...
(.venv) $ pip list
Package Version
---------- -------
pip 22.3
setuptools 63.2.0
It has been updated to source venv/local/bin/activate
I installed scrapy recently by using the pip command (pip install scrapy). Now I discovered that the installed version is 1.8.0. How to get it updated to the most recent 2.1.0? Uninstalling and reinstall did not work.
UPDATE, PARTLY SOLVED:
I updated ip through python -m pip install --upgrade --force-reinstall pip. That did not change the outcome of the pip install -U scrapy. But forcing pip to be run by python3 did. So after python3 -m pip install -U scrapy my scrapy version is now 2.1.0. Looks like some issues with the two python versions on my machines and some settings? Anybody can shine a light on this?
could you please advise me of a solution you may know for downloading PostgreSQL. I am trying to install 9.6.5 version, but also tried the 10.0, same error.
I am using an installation option for Mac operating system OS Sierra from website: https://www.openscg.com/bigsql/postgresql/installers.jsp/
I am getting an error:
Have tried to run the instruction sudo easy_install pip in the command line and it installs the pip file successfully. However I am still unable to install the PostgreSQL.
Please could you advise what the issue may be?
I have also installed Homebrew (it did not help).
I do already have anaconda and Python installed, as well as latest versions of R and RStudio.
I have now found a solution to the above problem (on Mac). Execute the following command in your terminal:
sudo easy_install-2.6 pip
If that does not work execute:
sudo easy_install-2.7 pip
This allows the PostgreSQL to be downloaded correctly.
I followed the instructions suggesting using easy_install-2.7 but still got an error very similar to that from the OP. I had to specifically install pip 9.0.0 with
sudo easy_install-2.7 pip=9.0.0
after which the PostgreSQL install worked.
The default pip is now v10, so it's probably a string compare issue in the installer.
Here is the solution that worked for me on Mac High Sierra 10.13.4:
Clear out the brew cache $ rm -rf ~/Library/Caches/Homebrew
Clear out the site-packages $ sudo rm -rf /usr/local/lib/python2.7/site-packages
Reinstall Python $ brew reinstall python This pulls down python-3.5.6.high_sierra and put it in /usr/local/bin/python3
But which python still shows /usr/bin/python
The solution is to run $ brew install python#2 which pulls down python#2-2.7.14_3.high_sierra
Now which python shows the correct path /usr/local/bin/python which is also where all your pip stuff is installed, so now pip will work.
Ensure the latest version of pip is installed with $ sudo pip install --upgrade pip
I am initializing a new VM with Ubuntu 17 on Google Cloud Platform, I then SSH into the newly created VM, upload this script and run it...
#! /bin/bash
sudo apt-get install python-pip
sudo pip install --upgrade pip
sudo pip install https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.5.0-cp27-none-linux_x86_64.whl
Now, this works for me, when I launch a Python interactive environment
import tensorflow as tf
does not throw an error, however, if I run the same script but replace
tensorflow-0.5.0-cp27-none-linux_x86_64.whl
with
tensorflow-1.3.0-cp27-none-linux_x86_64.whl
I get:
ImportError: No module named tensorflow
... incredibly frustrating, especially since the contrib library doesn't seem to be apart of the 0.5 version... any ideas of what is going on, perhaps how I can first install 0.5 and then upgrade to 1.3 ?
I also get the same then i tried pip install tensorflow after worked fine
I tried installing tensorflow on my system, but I received the following error:
tensorflow-0.5.0-cp27-none-linux_x86_64.whl is not a supported wheel on this platform
Exception Information captured in pip.log file:-
/home/gansai/tensorflow/bin/pip run on Wed Nov 11 00:19:05 2015
tensorflow-0.5.0-cp27-none-linux_x86_64.whl is not a supported wheel on this platform.
Exception information:
Traceback (most recent call last):
File "/home/gansai/tensorflow/local/lib/python2.7/site-packages/pip/basecommand.py", line 122, in main
status = self.run(options, args)
File "/home/gansai/tensorflow/local/lib/python2.7/site-packages/pip/commands/install.py", line 269, in run
InstallRequirement.from_line(name, None))
File "/home/gansai/tensorflow/local/lib/python2.7/site-packages/pip/req.py", line 168, in from_line
raise UnsupportedWheel("%s is not a supported wheel on this platform." % wheel.filename)
UnsupportedWheel: tensorflow-0.5.0-cp27-none-linux_x86_64.whl is not a supported wheel on this platform.
What could I do to install tensorflow and start experimenting it?
I guess pip3 is being used for installation
it can be solved by using pip2.7
I followed the steps in here
hope it helps you:)
tensorflow-0.5.0-cp27-none-linux_x86_64.whl is not a supported wheel on this platform
The above error comes because of trying to install TensorFlow onto a 32 bit system. As you could observe, the wheel was linux_x86_64, which is intended to be installed on 64 bit.
Steps to follow:-
Direct Binary Installation
Install Debian 64 bit OS. Download debian 64 bit ISO from torrent (http://cdimage.debian.org/debian-cd/current-live/amd64/bt-hybrid/)
Install python-dev. apt-get install python-dev
Install tensor-flow python2.7 -m pip install https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.5.0-cp27-none-linux_x86_64.whl
Docker Based Installation
Install Debian 64 bit OS. Download debian 64 bit ISO from torrent (http://cdimage.debian.org/debian-cd/current-live/amd64/bt-hybrid/)
Install Docker on Debian. Follow steps mentioned in http://docs.docker.com/engine/installation/debian/#debian-jessie-80-64-bit
Run docker container for tensorflow. docker run -it b.gcr.io/tensorflow/tensorflow. Follow steps mentioned in http://tensorflow.org/get_started/os_setup.md#docker-based_installation
The main point to be noted here is that, as of now, python wheel for tensorflow is supported for 64 bit system, as shared in pip install https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.5.0-cp27-none-linux_x86_64.whl
It might be unrelated but I had the same error with tensorflow-0.7.1-cp34-none-linux_x86_64.whl on a fresh Ubuntu Linux 14.04 LTS (64bit) and this is what has helped:
sudo apt-get install python3-setuptools -y && sudo easy_install3 pip -y && sudo apt-get install python 3.5-dev -y && sudo apt-get install python3.4-dev -y
sudo pip3 install --upgrade https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.7.1-cp34-none-linux_x86_64.whl
You can call a tensorflow script like this:
#call it with python3.4
python3.4 tensorflow_demo.py
While researching I often read about using wget and renaming the file but this became obsolete with the latest version, see here: https://github.com/tensorflow/tensorflow/issues/1142#issuecomment-186740120