pipenv shell failed creating virtual environment - pipenv

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

Related

Pipenv cannot create bin folder Ubuntu 22.04 LTS

I'm trying to setup Pipenv on Ubuntu 22.04 LTS and I used:
sudo apt install pipenv
but I get an error:
FileNotFoundError: [Errno 2] No such file or directory: '/home/foo/.local/share/virtualenvs/hello-JDpq8NmY/bin/python'
I tried to update pip with:
curl -sS https://bootstrap.pypa.io/get-pip.py | python3.10
Still no use.
I tried the solution suggested here and nothing changed.
The environment is there but the bin folder is missing.
I had the same problem. Remove pipenv from apt package manager and install pipenv with
pip install pipenv
After this you must set your PATH Variable to the pip dictionary.
A possible problem is related to pipenv not finding the python executable.
If this is your case is it possible to specify the path
pipenv install --python=/usr/bin/python3.10
Replace the path with desired python version
source

How to enable apt install in Bitnami containers?

I'm running a Bitnami/pytorch container and would like to install packages using apt. However I cannot do it as sudo is not installed. For example:
$ sudo apt install nano
bash: sudo: command not found
So what is the preferred way of getting apt install to work?

Run "From .." docker image inside Dockerfile

I'm building a image that builds a Jenkins and I try to use a plugin over the Jenkins when it is running, so, I need get run Jenkins before my plugin execution.
I execute it like docker build -t dockerfile and the error wich I am obtaining:
jenkins.JenkinsException: Error in request: [Errno 99]
Cannot assign requested address
I think the problem is when the plugin is executed it guess Jenkins is running and not.
FROM foxylion/jenkins
MAINTAINER Mishel Uchuari <dmuchuari#hotmail.com>
RUN /usr/local/bin/install-plugins.sh workflow-remote-loader workflow-aggregator build-pipeline-plugin
ENV JENKINS_USER replicate
ENV JENKINS_PASS replicate
USER root
RUN apt-get -y update && apt-get -y upgrade
RUN apt-get install -y apt-utils
RUN apt-get install -y python-pip
RUN apt install -y linuxbrew-wrapper
RUN useradd someuser -m -s /bin/bash
USER someuser
RUN chmod -R 777 /home/someuser
RUN brew install libyaml
USER root
RUN apt-get install build-essential
RUN apt-get -y update && apt-get -y upgrade
RUN pip install jenkins-job-builder==2.0.0.0b2
RUN pip install PyYAML python-jenkins
RUN mkdir /etc/jenkins_jobs/
COPY jenkins_jobs.ini /etc/jenkins_jobs/
COPY scm_pipeline.yaml /etc/jenkins_jobs/
RUN jenkins-jobs --conf /etc/jenkins_jobs/jenkins_jobs.ini update /etc/jenkins_jobs/scm_pipeline.yaml
I had the same issue myself when using it under Docker:
File "/src/.tox/py27/local/lib/python2.7/site-packages/jenkins_jobs/builder.py", line 124, in get_plugins_info
raise e
JenkinsException: Error in request: [Errno 99] Cannot assign requested address
That was caused when it tries to retrieve the list of plugins, I went overriding plugins_info to short circuit the code path:
jjb = JenkinsJobs(args=['test', config_dir, '-o', output_dir])
jjb.builder['plugins_info'] = [] # prevents 99 cannot assign requested address
jjb.execute()
I had the issue with python 2.7.9 on Debian Jessie. If I remember correctly that is no more an issue with a later python version eg 2.7.13 from Debian Stretch.
(the patch on which I encountered the issue):
https://gerrit.wikimedia.org/r/#/c/380929/8/tests/test_integration.py
RUN brew install libyaml
brew is a package manager for Mac OS X. Also PyYAML gracefully skip compilation when the lib is not availble. So you probably do not need that one. And I guess it would work without installing build-essential.
RUN pip install jenkins-job-builder==2.0.0.0b2
RUN pip install PyYAML python-jenkins
I am surprised you have install PyYAML and python-jenkins explicitly. Supposedly installing jenkins-job-builder should install all the dependencies (eg PyYAML and python-jenkins).

ImportError: No module named packaging.version

When I tried installing Flask I got this error:
ImportError: No module named packaging.version
To fix this, I had to do:
pip install setuptools
If your Python runs on Ubuntu, try to do this:
cd /usr/local/lib/python2.7/dist-packages
mv pkg_resources/ pkg_resources_bak/
I'm not sure what package installed the "pkg_resources", it will make pip always show error.
Try this
wget https://bootstrap.pypa.io/get-pip.py
sudo python get-pip.py
As an Ubuntu 14.04 user, upgrading pip to version 9.0.1 fixed this problem for me.
Upgrading pip normally
Download get-pip.py script
Run: python get-pip.py
Upgrading/installing pip behind a corporate firewall
Download get-pip.py script, along with pip, wheel, and setuptools from pypi
Place all files in the /tmp directory
Run the following command to install pip: sudo -H python /tmp/get-pip.py --no-index --find-links=/tmp pip
In case anyone stumbles upon this problem, my solution was to change the packaging version from 22.0 to 21.3.

pip cannot install websocket-server python packge

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).

Resources