Running python3 -m venv project return exit status 1 - python-3.6

According to the venv documentation in Python3:
Changed in version 3.5: The use of venv is now recommended for creating virtual environments.
With Python3.6 installed in my Ubuntu 16, I tried to create a Python project with command python3 -m venv project, but got the following error:
Error: Command '['/home/me/git/project/bin/python3', '-Im', 'ensurepip', '--upgrade', '--default-pip']' returned non-zero exit status 1.
Question: Why could this have happened? and how to resolve?

sudo apt-get install -y python3-pip is worth a try, based on https://www.digitalocean.com/community/tutorials/how-to-install-python-3-and-set-up-a-programming-environment-on-an-ubuntu-16-04-server
If that fails, what does python3 --version print?

Related

I can't install lableImg Annotation tool in M1 Mac

While installing LabelImg in M1 Mac using below command
pip install pyqt5 lxml
This is the error I got
ERROR: pyqt5 from https://files.pythonhosted.org/packages/7c/5b/e760ec4f868cb77cee45b4554bf15d3fe6972176e89c4e3faac941213694/PyQt5-5.14.0.tar.gz#sha256=0145a6b7de15756366decb736c349a0cb510d706c83fda5b8cd9e0557bc1da72 has a pyproject.toml file that does not comply with PEP 518: 'build-system.requires' contains an invalid requirement: 'sip >=5.0.1 <6'
How to install lableImg annotation tool in M1 Mac?
I got it to work by using the following commands
brew install pyqt#5
pip install labelimg
And that's it, it just works
You just need to type labelimg in the Terminal and the app will start running
I don't know why they don't tell you this in the installation guide
Alrighty!
On MacOS Monterey, none of the other solutions posted here solved this problem for me. However, I managed to easily solve the issue, without a virtual environment or too much fiddling about like so:
Firstly, you have to download all labelImg packages from this link:
https://github.com/tzutalin/labelImg#macos
(You can download it as a .zip file or clone it)
Unzip and then in your terminal cd into whatever directory you downloaded the above files to.
Then run the following commands in order:
pyrcc5 -o libs/resources.py resources.qrc
Then,
pip3 install lxml
Finally,
python3 labelImg.py
It should run without an issue now.
You can go one of two ways:
Using brew:
You can use homebrew to install the dependencies - like qt and libxml2. This will let your package manager handle everything and generally should solve the problem with the . Then you can run
python3 labelimg.py
Using Virtual Environments:
This is the more recommended way to go about in such cases. You can use conda, pipenv or venv to create a virtual environment which is isolated from your system python installation. Then you can try to install it as explained in the README.rst in the root of the repository:
brew install python3
pip3 install pipenv
pipenv run pip install pyqt5==5.12.1 lxml
pipenv run make qt5py3
pipenv run python3 labelImg.py
[Optional] rm -rf build dist; python setup.py py2app -A;mv "dist/labelImg.app" /Applications
You can try the two methods and and get back with the errors if there are any.
This is my note.
I just succeed on my Mac M1 Chip
CHECK THIS OUT!
Installation of labelimg on mac m1 chip
my first reference
my second reference
First, you must use terminal with rosetta version
Then, you already have python3
Then...
[Done]
# check where python3 is
$ where python3
# create env
$ /usr/bin/python3 -m venv env
# check env is
$ where env
# activate env list
$ source env/bin/activate
# updated to the newest
$ pip install --upgrade pip
# installation of PyQt5
$ pip install PyQt5
# start to run labelImg.py
$ cd Documents/repos/labelImg
$ pip3 install pyqt5 lxml
$ make qt5py3
# [run ok!!]
$ python3 labelImg.py
Using Conda
Create a virtual environment in conda and activate it
conda create -n venv
conda activate venv
Install pyqt using conda
conda install pyqt
Install lxml using pip
pip install lxml
Change directory to the downloaded/cloned labelImg folder
cd path/to/labelImg/folder/
Make qt5py3
make qt5py3
Run LabelImg
python labelImg.py

Virtual Environment Setup Fails on CentOS7 With Python3.6

Following these directions:
https://www.digitalocean.com/community/tutorials/how-to-install-python-3-and-set-up-a-local-programming-environment-on-centos-7
The following command:
$ python3.6 -m venv my_env
Will give the error:
Error: Command '['/home/username/mudlan-master/environments/my_env/bin/python3.6', '-Im', 'ensurepip', '--upgrade', '--default-pip']' returned non-zero exit status 1.
How do I fix this?
I had pip3 installed locally outside of the package manager. I removed it from /usr/local/bin/pip3*, and reinstalled:
$ sudo yum remove python36u-pip
$ sudo yum install python36u-pip

Error while install airflow: By default one of Airflow's dependencies installs a GPL

Getting the following error after running pip install airflow[postgres] command:
> raise RuntimeError("By default one of Airflow's dependencies installs
> a GPL "
>
> RuntimeError: By default one of Airflow's dependencies installs a GPL
> dependency (unidecode). To avoid this dependency set
> SLUGIFY_USES_TEXT_UNIDECODE=yes in your environment when you install
> or upgrade Airflow. To force installing the GPL version set
> AIRFLOW_GPL_UNIDECODE
I am trying to install in Debian 9
Try the following:
export AIRFLOW_GPL_UNIDECODE=yes
OR
export SLUGIFY_USES_TEXT_UNIDECODE=yes
Using export makes the environment variable available to all the subprocesses.
Also, make sure you are using pip install apache-airflow[postgres] and not pip install airflow[postgres]
Which should you use: if using AIRFLOW_GPL_UNIDECODE, airflow will install a dependency that is under GPL license, which means you won't be able to distribute your resulting application commercially. If that's a problem for you, go for SLUGIFY_USES_TEXT_UNIDECODE.
If you are installing using sudo run one of these commands:
sudo AIRFLOW_GPL_UNIDECODE=yes pip3 install apache-airflow
OR
sudo SLUGIFY_USES_TEXT_UNIDECODE=yes pip3 install apache-airflow
NOTE: If pip3 (python3) does not work for you, try pip command.
The pip command can be pointing to python2 or python3 installation depending on your system. Verify this by running pip --version.
Windows users can use the command below before installing apache-airflow:
$ set AIRFLOW_GPL_UNIDECODE=yes
then
$ pip install apache-airflow
In case you are installing the airflow on Windows and through Python terminal then you need to write this:
Set SLUGIFY_USES_TEXT_UNIDECODE=yes
pip install apache-airflow[postgres]
It worked with me after I struggled with trying many other options. Hope this will work with you too.
Below command should install apache-airflow and lets you pull changes into PyCharm for building DAGs and coding for Airflow.
SLUGIFY_USES_TEXT_UNIDECODE=yes
pip install apache-airflow
Also, if you are installing using sudo you can use:
export AIRFLOW_GPL_UNIDECODE='yes'
sudo -E pip3 install apache-airflow
(or use SLUGIFY_USES_TEXT_UNIDECODE)
Run the following command in your python terminal: SLUGIFY_USES_TEXT_UNIDECODE=yes pip install apache-airflow==1.10.0
Use below command to install apache-airflow
sudo SLUGIFY_USES_TEXT_UNIDECODE=yes \
pip install apache-airflow[async,devel,celery,crypto,druid,gcp_api,jdbc,hdfs,hive,kerberos,ldap,password,postgres,qds,rabbitmq,s3,samba,slack]

getting "pygpu was configured but could not be imported" error while trying with OpenCL+Theano on AMD Radeon

I have followed the instructions from this:
https://gist.github.com/jarutis/ff28bca8cfb9ce0c8b1a
But then when I tried : THEANO_FLAGS=device=opencl0:0 python test.py
on the test file I am getting error:
ERROR (theano.sandbox.gpuarray): pygpu was configured but could not be imported
Traceback (most recent call last):
File "/home/mesayantan/.local/lib/python2.7/site-packages/theano/sandbox/gpuarray/init.py", line 20, in
import pygpu
File "/usr/src/gtest/clBLAS/build/libgpuarray/pygpu/init.py", line 7, in
from . import gpuarray, elemwise, reduction
File "/usr/src/gtest/clBLAS/build/libgpuarray/pygpu/elemwise.py", line 3, in
from .dtypes import dtype_to_ctype, get_common_dtype
File "/usr/src/gtest/clBLAS/build/libgpuarray/pygpu/dtypes.py", line 6, in
from . import gpuarray
ImportError: cannot import name gpuarray
I do not have good idea. I am using all these for the first time. I am working on Ubuntu 14.04 LTS. How can I resolve this error?
I fixed this issue with the step-by-step installation given in the lipgpuarray website!
Download
git clone https://github.com/Theano/libgpuarray.git
cd libgpuarray
Install libgpuarray
# extract or clone the source to <dir>
cd <dir>
mkdir Build
cd Build
# you can pass -DCMAKE_INSTALL_PREFIX=/path/to/somewhere to install to an alternate location
cmake .. -DCMAKE_BUILD_TYPE=Release # or Debug if you are investigating a crash
make
make install
cd ..
Install pygpu
# This must be done after libgpuarray is installed as per instructions above.
python setup.py build
python setup.py install
Source:
http://deeplearning.net/software/libgpuarray/installation.html
This worked for me!
Good Luck
Installing the blas library seems enough. I'm doing tests for the same problem.
cd ~
git clone https://github.com/clMathLibraries/clBLAS.git
cd clBLAS/
mkdir build
cd build/
sudo apt-cache search openblas
sudo apt-get install libopenblas-base libopenblas-dev
sudo apt-get install liblapack3gf liblapack-doc liblapack-dev
cmake ../src
make
sudo make install
And after that
git clone https://github.com/Theano/libgpuarray.git
cd libgpuarray
mkdir Build
cd Build
cmake .. -DCMAKE_BUILD_TYPE=Release
make
sudo make install
cd ..
sudo apt-get install cython
sudo apt-get install python-numpy python-scipy python-dev python-pip python-nose g++ libopenblas-dev git
Building and Installing with regard to python3
python3 setup.py build
sudo -H python3 setup.py install
I hope it can help you. Now just the dev version of theano is missing for me.

.net core raspberry pi 3 Error: Download failed

I try to follow the guide bellow to install .net core on my raspberry pi 3:
https://www.microsoft.com/net/core#debian
The script told me to install below:
dotnet_install: Error: Unable to locate libunwind. Install libunwind to continue
dotnet_install: Error: Unable to locate gettext. Install gettext to continue
i install them using apt-get install, and everything fine:
sudo apt-get install libunwind-dev
sudo apt-get install gettext
but no luck, when i run below :
sudo curl -sSL https://raw.githubusercontent.com/dotnet/cli/rel/1.0.0/scripts/obtain/dotnet-install.sh | bash /dev/stdin --version 1.0.0-preview1-002702 --install-dir ~/dotnet
i got:
dotnet_install: Error: Download failed
Are there any missing?
Please use last valid URL:
curl -sSL https://raw.githubusercontent.com/dotnet/cli/rel/1.0.0-preview1/scripts/obtain/dotnet-install.sh | bash /dev/stdin --version 1.0.0-preview1-002702 --install-dir ~/dotnet
And it downloads and installs successfully on latest Raspbian on Raspberry Pi 2 (I think there should be no problem with Raspberry Pi 3).
However, after successful install, there is a error:
bash: dotnet: cannot execute binary file: Exec format error
I believe this is because of ARM architecture, because currently only amd64 (x64) is supported.

Resources