I've tried installing Pyside2-uic using :
sudo apt-get install -y python-pyside2
sudo apt-get install pyside2-tools
while I'm converting the .ui file to .py using pyside2-uic still i get error as " ImportError: No module named pyside2uic.driver "
Traceback (most recent call last):
File "/usr/bin/pyside2-uic", line 28, in <module>
from pyside2uic.driver import Driver
ImportError: No module named pyside2uic.driver
How to resolve this error
I tried these commands and it worked.
$ apt-get install wget python-pip python-dev software-properties-common
$ add-apt-repository ppa:beineri/opt-qt561-trusty
$ apt-get update
$ apt-get install qt56-meta-full
$ . /opt/qt56/bin/qt56-env.sh
$ wget https://bintray.com/fredrikaverpil/pyside2-wheels/download_file?file_path=ubuntu14.04%2FPySide2-2.0.0.dev0-cp27-none-linux_x86_64.whl -O PySide2-2.0.0.dev0-cp27-none-linux_x86_64.whl
$ pip install PySide2-2.0.0.dev0-cp27-none-linux_x86_64.whl
$ pyside2-uic
Related
FROM ubuntu:latest
RUN apt-get update
RUN apt-get install
RUN apt install python3.9 -y
RUN apt-get install -y git
RUN apt-get -y install python3-pip
RUN git clone https://ACCESS_TOKEN#github.com/username/repo
WORKDIR ./appy/
RUN pip install -r requirements.txt
CMD ["python3.9", "main.py"]
Hey, for some reason I'm getings
Traceback (most recent call last):
File "/appy/main.py", line 7, in <module>
import disnake
ModuleNotFoundError: No module named 'disnake'
requirements.txt
disnake=2.4.0
psutil=5.8.0
motor=2.5.1
aiohttp=3.7.4.post0
It appears that the packages in requirements.txt are not being installed properly. Any suggestions to what could be causing this? when building the container there doesn't seem to be any errors.And I can visually see when the container is built that all packages are installed. Including disnake.
I trying to install Python GDAL/OGR bindings to be accessible directly from Python interpreter on Docker python:3.6-stretch image.
My Dockerfile looks like that:
FROM python:3.6-stretch
ENV PYTHONUNBUFFERED 1
ENV LANG=C.UTF-8 LC_ALL=C.UTF-8
RUN apt-get update && apt-get install -y \
binutils \
libproj-dev \
gdal-bin \
libgdal-dev \
python3-gdal \
python3-pip \
python-numpy \
python-dev \
vim
COPY . /app
RUN pip3 install --no-cache-dir -r /app/requirements.txt \
&& rm -rf /requirements.txt
WORKDIR /app
Dockerfile installs current stable version of GDAL and python3-gdal which is 2.1.2.
Import osgeo from Python interpreter gives me an error:
>>> from osgeo import gdal
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'osgeo'
How to install neccessary libs properly?
Check if you are using correct python 3 interpreter. You can call in linux system:
whereis python3
You had install python3-pip package, so you have osgeo in your main python 3 in /usr/bin/python3. In other python 3 locations osgeo can be not available.
I solved this problem by installing via Python PIP pygdal package. Firstly you need to check Gdal version installed on the machine, and install proper pygdal.
$ gdalinfo --version
GDAL 2.1.3, released 2017/20/01
$ pip install "pygda>=2.1.2,<2.1.3"
I try to use pjsua module for Python on Ubuntu 16.04.
When I try to call AccountConfig, it will return with following error message:
>>> import pjsua
>>> t=pjsua.AccountConfig()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "pjsua.py", line 802, in __init__
self._cvt_from_pjsua(default)
File "pjsua.py", line 859, in _cvt_from_pjsua
for cred in cfg.cred_info:
MemoryError
Compiled pjsip with following:
sudo apt-get install build-essential python-dev libpjsua2
wget http://www.pjsip.org/release/2.7.2/pjproject-2.7.2.tar.bz2
sudo rm -fr pjproject-2.7.2
tar -xf pjproject-2.7.2.tar.bz2 && cd pjproject-2.7.2/
export CFLAGS="$CFLAGS -fPIC"
./configure --enable-shared --disable-sound && make dep && make
cd pjsip-apps/src/python/
sudo python setup.py install
I would appreciate any idea, what am I doing wrong.
Compile with following solved the issue:
sudo apt-get update
sudo apt-get -y install build-essential python-dev libpjsua2 libssl-dev libasound2-dev
wget http://www.pjsip.org/release/2.7.2/pjproject-2.7.2.tar.bz2
tar -xf pjproject-2.7.2.tar.bz2 && cd pjproject-2.7.2/
export CFLAGS="$CFLAGS -fPIC"
./configure && make dep && make
cd pjsip-apps/src/python/
sudo python setup.py install
FROM ubuntu:14.04.2
RUN rm /bin/sh && ln -s /bin/bash /bin/sh
RUN apt-get -y update && apt-get upgrade -y
RUN apt-get install python build-essential python-dev python-pip python-setuptools -y
RUN apt-get install libxml2-dev libxslt1-dev python-dev -y
RUN apt-get install libpq-dev postgresql-common postgresql-client -y
RUN apt-get install openssl openssl-blacklist openssl-blacklist-extra -y
RUN apt-get install nginx -y
RUN pip install "pip>=7.0"
RUN pip install virtualenv uwsgi
ADD canonicaliser_api /home/ubuntu/canonicaliser_api
RUN virtualenv /home/ubuntu/canonicaliser_api/venv
RUN source /home/ubuntu/canonicaliser_api/venv/bin/activate && pip install -r /home/ubuntu/canonicaliser_api/requirements.txt
RUN export CFLAGS=-I/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/numpy/core/include/
RUN source /home/ubuntu/canonicaliser_api/venv/bin/activate && \
python /home/ubuntu/canonicaliser_api/canonicaliser/cython_extensions/setup.py \
build_ext --inplace
The last line crashes with:
Traceback (most recent call last):
File "/home/ubuntu/canonicaliser_api/canonicaliser/cython_extensions/setup.py", line 5, in <module>
ext_modules = cythonize("*.pyx")
File "/home/ubuntu/canonicaliser_api/venv/local/lib/python2.7/site-packages/Cython/Build/Dependencies.py", line 754, in cythonize
aliases=aliases)
File "/home/ubuntu/canonicaliser_api/venv/local/lib/python2.7/site-packages/Cython/Build/Dependencies.py", line 649, in create_extension_list
for file in nonempty(extended_iglob(filepattern), "'%s' doesn't match any files" % filepattern):
File "/home/ubuntu/canonicaliser_api/venv/local/lib/python2.7/site-packages/Cython/Build/Dependencies.py", line 103, in nonempty
raise ValueError(error_msg)
ValueError: '*.pyx' doesn't match any files
...
What am I missing please?
I found the problem.
I had to downgrade to Cython 0.21 (This is main reason for the
error in question)
Afterwards I got another problem as the script didn't generate
anything, despite not throwing any errors. Solution to that was to be in that directory before executing it.
e.g.:
RUN source /home/ubuntu/canonicaliser_api/venv/bin/activate && cd /home/ubuntu/canonicaliser_api/canonicaliser/cython_extensions/ && python setup.py build_ext --inplace
The painful part about Docker seems that you have to chain all commmands as it seems to be stateless.
I am trying to setup mysqlfailover utility on ec2 instance running Ubuntu 12.04. I performed the following steps:
Downloaded mysql-connector-python:
wget http://cdn.mysql.com/Downloads/Connector-Python/mysql-connector-python_1.0.12-1debian6.0_all.deb -o mysql-connector-python_1.0.12-1debian6.0_all.deb
(Installed using dpkg -i command.)
Download mysql-utilities:
wget http://cdn.mysql.com/Downloads/MySQLGUITools/mysql-utilities_1.3.5-1debian6.0_all.deb -o mysql-utilities_1.3.5-1debian6.0_all.deb
(Installed using dpkg -i command.)
There were some dependencies issues. I ran the following commands:
sudo apt-get install python-pip
easy_install -U distribute
sudo apt-get install libmysqlclient-dev
sudo apt-get install python-dev
pip install mysql-python
Now, when I run the command mysqlfailover, it gives the following error:
Traceback (most recent call last):
File "/usr/bin/mysqlfailover", line 24, in <module>
from mysql.utilities.common.tools import check_python_version
ImportError: No module named mysql.utilities.common.tools
I have been banging my head around quite some time now, but no success. Any help in the matter is highly appreciated. Thanks.
Try env PYTHONPATH=/usr/share/pyshared/ mysqlfailover
Thers is no utilities in mysql modul, you can check this do:
ls /usr/lib/python2.7/dist-packages/mysql
So you should change mysql package:
cp -r /usr/share/pysharedmysql /usr/lib/python2.7/dist-packages/mysql