I have upgrade my pip.
sudo pip install --upgrade pip
And used
sudo pip install openopt
its say
Collecting sortedcontainers
Downloading https://files.pythonhosted.org/packages/13/f3/cf85f7c3a2dbd1a515d51e1f1676d971abe41bba6f4ab5443240d9a78e5b/sortedcontainers-2.1.0-py2.py3-none-any.whl
Processing
./Library/Caches/pip/wheels/e6/b1/a6/9719530228e258eba904501fef99d5d85c80d52bd8f14438a3/setproctitle-1.1.10-cp27-cp27m-macosx_10_15_x86_64.whl
Installing collected packages: sortedcontainers, setproctitle, openopt
Successfully installed openopt-0.5629 setproctitle-1.1.10 sortedcontainers-2.1.0
from openopt import QP
ModuleNotFoundError: No module named 'openopt'
Related
I am trying to install some packages into my docker environment so I can use them inside a container. But when I am running my Dockerfile I am getting the following error:
ERROR: Could not find a version that satisfies the requirement qt5 (from versions: none)
ERROR: No matching distribution found for qt5
Can someone please help me with this problem?
My Dockerfile:
FROM python:latest
WORKDIR /usr/src/app
RUN python3 -m pip install --upgrade pip
RUN pip3 install qt5
RUN pip3 install pyqt5
COPY ./server.py /app/
COPY ./hinto.py /app/
Note: I already have those packages successfully running on my host machine (Macbook m1)
From
https://pypi.org/project/PyQt5/
The GPL version of PyQt5 can be installed from PyPI:
Install it using:
pip3 install PyQt5
this is my first time running Docker and I am having issues creating the image. This is the code inside my docker file
FROM alpine:latest
ENV PATH /usr/local/bin:$PATH
RUN apk add --no-cache python3 py3-pip
RUN apk add py3-pip && pip3 install --upgrade pip
WORKDIR /backend
COPY . /backend
RUN pip3 install wheel
RUN pip3 install numpy
RUN pip3 --no-cache-dir install -r requirements.txt
Under requirements.txt, I have numpy==1.23.1.
The relevant error codes are
#12 8.606 Building wheel for numpy (pyproject.toml): started
#12 22.30 Building wheel for numpy (pyproject.toml): finished with status 'error'
#12 22.34 ERROR: Could not build wheels for numpy, which is required to install pyproject.toml-based projects
------
executor failed running [/bin/sh -c pip3 install numpy]: exit code: 1
I tried searching for solutions but they mentioned that once you upgraded PIP, things should install fine. In this case, they still do not work well.
Do give any advice!
Try pip3 install --extra-index-url https://alpine-wheels.github.io/index numpy isntead. Does that work? If so, I can explain in an answer
The above comment by FlyingTeller provided a solution for the problem.
I am trying to build a new docker image by adding some python packages to my base docker image. The sudo docker build -t myimage1:cuda10.2 . runs without any issues but I cannot import any of the packages in the new image. I am using sudo docker run --gpus all -it myimage1:cuda10.2 to run the image. Can somebody help me understand what am I missing here?
Dockerfile
FROM nvcr.io/nvidia/rapidsai/rapidsai:cuda10.2-runtime-ubuntu18.04
WORKDIR /rapids/notebooks/
COPY requirements.txt ./
RUN pip install --upgrade pip && \
pip install --no-cache-dir -r requirements.txt
requirements.txt
ujson
This is the trace for docker build
Sending build context to Docker daemon 4.096kB
Step 1/5 : FROM nvcr.io/nvidia/rapidsai/rapidsai:cuda10.2-runtime-ubuntu18.04
---> 98901cabda0a
Step 2/5 : WORKDIR /rapids/notebooks/
---> Using cache
---> 162a9bb732c7
Step 3/5 : COPY requirements.txt ./
---> 7bb48a384987
Step 4/5 : RUN pip install --upgrade pip && pip install --no-cache-dir -r requirements.txt
---> Running in 5f3ca4ed3f93
Collecting pip
Downloading pip-20.2.4-py2.py3-none-any.whl (1.5 MB)
Installing collected packages: pip
Attempting uninstall: pip
Found existing installation: pip 20.0.2
Uninstalling pip-20.0.2:
Successfully uninstalled pip-20.0.2
Successfully installed pip-20.2.4
Collecting ujson
Downloading ujson-4.0.1-cp38-cp38-manylinux1_x86_64.whl (181 kB)
Installing collected packages: ujson
Successfully installed ujson-4.0.1
Removing intermediate container 5f3ca4ed3f93
---> 58e94a2c4c98
Step 5/5 : COPY . .
---> d5897f4da4ff
Successfully built d5897f4da4ff
Successfully tagged myimage1:cuda10.2
If I run the image and do pip install ujson This is what I get
Collecting ujson
Downloading ujson-4.0.1-cp37-cp37m-manylinux1_x86_64.whl (179 kB)
|████████████████████████████████| 179 kB 947 kB/s
Installing collected packages: ujson
Successfully installed ujson-4.0.1
The only difference is that the ujson package is cp37 while that installed by Dockerfile is cp38? Can somebody explain why the packages installed are for different Python versions?
In the rapids containers there's a virtual environment named rapids where all of the packages are installed and is activated in the default entrypoint for the container. You should change your RUN command to:
RUN source activate rapids && \
pip install --upgrade pip && \
pip install --no-cache-dir -r requirements.txt
I am trying to create a virtual environment with the following command:
pipenv --three
But it doesn't work as the image shows:
What should I do?
I don't have virtual environment(s), like venv or virtualenv.
I had a similar problem and solved it in the following way
Uninstall PIP and pipenv, reinstall the version of python3. If not work, reinstall Python 3.7
sudo apt remove pip
sudo apt remove pipenv
sudo apt install python3-venv python3-pip
pip3 install pipenv
pipenv shell
Installing pip/setuptools/wheel with Linux Package Managers
I am inside my docker container, which is running centos6.6.1, and cannot seem to install the python package websocket-server.
pip install websocket-server
Could not find a version that satisfies the requirement websocket-server (from versions: )
I managed to get around this issue with the following command:
pip install git+http://github.com/Pithikos/python-websocket-server
but I don't like having to clone the repo in order to install the package. Any ideas how I can avoid this work around and get the first pip install to work?
I have the same problem with python package influxdb!
First what You need to do inside docker is upgrade pip and setuptools packages:
pip install -U setuptools pip
Do it inside virtualenv (if You use it).