I am trying to install pyoptsparse. In order to do that, I set a Conda environment on PyCharm. Then I added conda-forge channel, where the pyoptsparse package should be, but when I am trying to install it through the command : conda install pyoptsparse , it always returns me that the package does not exist.
Has someone already faced to this same problem?
I may precise that I am using a Windows machine.
https://anaconda.org/conda-forge/pyoptsparse
https://mdolab-pyoptsparse.readthedocs-hosted.com/en/latest/install.html
The documentation states that Windows is not supported. Either run through WSL or attempt installing through pip.
However, attempting to install through pip appears to fail during compilation for the win-64 platform, at least when using the following environment:
so-pyoptsparse.yaml
name: so-pyoptsparse
channels:
- conda-forge
- defaults
dependencies:
- python=3.9
- numpy
- sqlitedict >=1.6
- scipy >=1.2
- mdolab-baseclasses >=1.3.1
- swig
- compilers
- pip
- pip:
- git+https://github.com/mdolab/pyoptsparse.git#v2.8.2
Details on how it fails can be found in the logs of the GitHub Workflow run.
I'm working on CI for my Python + Django project. I have to use the python:3.9-alpine image. A weird error is popping in my CI pipelines:
WARNING: Discarding https://files.pythonhosted.org/packages/aa/8a/7c80e7e44fb1b4277e89bd9ca509aefdd4dd1b2c547c6f293afe9f7ffd04/psycopg2-2.9.1.tar.gz#sha256=de5303a6f1d0a7a34b9d40e4d3bef684ccc44a49bbe3eb85e3c0bffb4a131b7c (from https://pypi.org/simple/psycopg2/) (requires-python:>=3.6). Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
ERROR: Could not find a version that satisfies the requirement psycopg2==2.9.1 (from versions: 2.0.10, 2.0.11, 2.0.12, 2.0.13, 2.0.14, 2.2.0, 2.2.1, 2.2.2, 2.3.0, 2.3.1, 2.3.2, 2.4, 2.4.1, 2.4.2, 2.4.3, 2.4.4, 2.4.5, 2.4.6, 2.5, 2.5.1, 2.5.2, 2.5.3, 2.5.4, 2.5.5, 2.6, 2.6.1, 2.6.2, 2.7, 2.7.1, 2.7.2, 2.7.3, 2.7.3.1, 2.7.3.2, 2.7.4, 2.7.5, 2.7.6, 2.7.6.1, 2.7.7, 2.8, 2.8.1, 2.8.2, 2.8.3, 2.8.4, 2.8.5, 2.8.6, 2.9, 2.9.1, 2.9.2)
Preparing metadata (setup.py): finished with status 'error'
ERROR: No matching distribution found for psycopg2==2.9.1
I see 2.9.1 in list of avaliable versions
My .gitlab-ci.yml
stages:
- linter
- build_pip
- build
- meta
- code_quality
- deploy
.except-tags:
except:
- tags
build_pip:build_dist:
stage: build_pip
# image: $CI_DEPENDENCY_PROXY_GROUP_IMAGE_PREFIX/python:3.9-alpine
image: python:3.9-alpine
variables:
OPENCV_VERSION: "4.5.3.56"
before_script:
- pip install --upgrade pip setuptools wheel
- apk update apk add -q --update --no-cache
- postgresql-dev musl-dev
...
- pip install -r requirements/production.txt --no-cache
script:
- python setup.py bdist_wheel
- echo PIP_CI_JOB_ID=$CI_JOB_ID > PIP_CI_JOB_ID.env
dependencies: []
artifacts:
expire_in: 1 hour
paths:
- dist/
- version
reports:
dotenv: PIP_CI_JOB_ID.env
extends:
- .except-tags
...
requirements/production.txt
djangorestframework==3.12.4
drf-extra-fields==3.1.1
djangorestframework-camel-case==1.2.0 # https://pypi.org/project/djangorestframework-camel-case/
Pillow==8.3.2
python-dateutil==2.8.2 # datetime formatting
psycopg2==2.9.1
opencv-python==4.5.3.56
drf-yasg==1.20.0
sentry-sdk==1.4.3
gunicorn==20.1.0
requests==2.26.0
yarl==1.7.0
googlemaps==4.5.3
django_redis==5.0.0
celery==5.2.0
channels==3.0.4
channels_redis==3.3.1
Full gitlab ci log: https://pastebin.com/QhMhErF7
What is the reason for this error?
I tried to replace psycopg2 with psycopg2-binary but the same error occours.
What is the reason of my error?
Did you read my previous answer to a similar question of yours? The last part warns about certain combinations of Alpine + Python and this seems to be happening right now.
I tried to replace psycopg2 with psycopg2-binary but have the same error
The problem here might be a python library that has dependencies on gcc, which is not shipped on alpine by default.
Try replacing this:
before_script:
- pip install --upgrade pip setuptools wheel
- apk update
- apk add -q --update --no-cache postgresql-dev musl-dev
with:
before_script:
- pip install --upgrade pip setuptools wheel
- apk update
- apk add -q --no-cache postgresql-dev gcc python3-dev musl-dev
Notice that adding gcc will increase the image size, since this might be a dependency for either psycopg2 or psycopg2-binary. If the image size grows a lot I see no point in sticking with alpine, you could just avoid more Python headaches by switching to a debian-based image.
I'm trying to implement YOLO3 object detection using tensorflow 2.0 on google colab : https://github.com/theAIGuysCode/Object-Detection-API
And for this particular line:
!python3 /content/Object-Detection-API/load_weights.py
I'm facing this error:
ModuleNotFoundError: No module named 'keras_preprocessing'
I tried installing 'keras_preprocessing' using this command:
!conda install keras_preprocessing
and then I'm facing this error:
Collecting package metadata (repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
PackagesNotFoundError: The following packages are not available from current channels:
- keras_preprocessing
Current channels:
- https://repo.anaconda.com/pkgs/main/linux-64
- https://repo.anaconda.com/pkgs/main/noarch
- https://repo.anaconda.com/pkgs/r/linux-64
- https://repo.anaconda.com/pkgs/r/noarch
To search for alternate channels that may provide the conda package you're
looking for, navigate to
https://anaconda.org
and use the search bar at the top of the page.
Please help me solve the same!
Thank you!
From the Anaconda repository of the Keras Preprocessing package, you can install it with
conda install -c conda-forge keras-preprocessing
that is, with an - instead of _ and with selecting the conda-forge channel.
Try this
pip install Keras-Preprocessing
TensorFlow 2.2.0 + Keras 2.3.1 on Python 3.7
How to fix this AttributeError? I reinstall the TensorFlow but it does not work.
I had an exact same issue with Python 3.5.6 :: Anaconda, Inc. but I don't think it's Python's or TF version fault.
Frankly speaking, decided to create a new py-env like this (given that I use conda distro):
Created this env.yml file:
name: tf2
channels:
- defaults
- anaconda
dependencies:
- jupyter
- matplotlib
- numpy
- python=3.7
- scikit-learn
- tensorflow
then ran
conda env create -f env.yml
conda activate tf2
python -m ipykernel install --user --name=tf2
jupyter notebook
and it all works:
The package can't be installed with conda install command and its documentation shows only the pip install.
This is the error:
PackagesNotFoundError: The following packages are not available from current channels:
- scrapy-user-agent
Current channels:
- https://repo.anaconda.com/pkgs/main/win-64
- https://repo.anaconda.com/pkgs/main/noarch
- https://repo.anaconda.com/pkgs/r/win-64
- https://repo.anaconda.com/pkgs/r/noarch
- https://repo.anaconda.com/pkgs/msys2/win-64
- https://repo.anaconda.com/pkgs/msys2/noarch
To search for alternate channels that may provide the conda package you're
looking for, navigate to
https://anaconda.org
and use the search bar at the top of the page.