1

I am using a form of Lubuntu called GalliumOS (optimized for Chromebooks). I installed pip using $ sudo apt-get install python-pip. I then used pip install --user virtualenv and pip install virtualenv, and then when I tried to subsequently use virtualenv venv I experienced the message bash: virtualenv: command not found.

Between the pip installs above, I used pip uninstall virtualenv to get back to square one. The error remained after a reinstall.

I read several other posts, but all of them seemed to deal with similar problems on MacOS. One that came close was installing python pip and virtualenv simultaneously. Since I had already installed pip, I didn't think that these quite applied to my issue. Why is pip install virtualenv not working this way on LUbuntu / GalliumOS?

Thom Ives
  • 3,642
  • 3
  • 30
  • 29
  • 2
    If you want to post a question to which you already have the answer, you should post just the question in the "Question" box and put the answer separately in the "Answer" box. Otherwise, your question isn't a question. – jwodder Jul 14 '17 at 21:57
  • 1
    @thom-ives Please post your answer as an answer, so that someone else, whose time will be saved, can upvote it. – running.t Jul 14 '17 at 22:00
  • 1
    Possible duplicate of [What's the proper way to install pip, virtualenv, and distribute for Python?](https://stackoverflow.com/q/4324558/608639). Also see [Differences between distribute, distutils, setuptools and distutils2?](https://stackoverflow.com/a/14753678/608639) – jww Jul 14 '17 at 22:19
  • 1
    Possible duplicate of [What's the proper way to install pip, virtualenv, and distribute for Python?](https://stackoverflow.com/questions/4324558/whats-the-proper-way-to-install-pip-virtualenv-and-distribute-for-python) – eyllanesc Jul 14 '17 at 22:45
  • Thanks guys for clarifying the best way to post in these cases. I will seek to clarify as you've suggested OR delete my post. – Thom Ives Jul 15 '17 at 02:24
  • When you do `sudo pip install virtualenv`, what directory is `virtualenv` installed to? – Code-Apprentice Jul 15 '17 at 02:54

3 Answers3

2

Are you sure pip install is "failing"? To me, it sounds like the directory to which pip is installing modules on your machine is not in your PATH environment variable, so when virtualenv is installed, your computer has no idea where to find it when you just type in virtualenv.

Find where pip is installing things on your computer, and then check if the directory where the pyenv executable is placed is in your PATH variable (e.g. by doing echo $PATH to print your PATH variable). If it's not, you need to update your PATH variable by adding the following to your .bashrc or .bash_profile or etc.:

export PATH="PATH_TO_WHERE_PIP_PUTS_EXECUTABLES:$PATH"

Niema Moshiri
  • 909
  • 5
  • 14
2

What finally worked for me was this. I used

$ sudo apt-get install python-virtualenv.

I was then able to create a virtual environment using $ virtualenv venv.

I was seeking to avoid using $ sudo pip install virtualenv, because of admonitions in other posts to not do this, and agreed, because of experiences I'd had with subsequent difficulties when doing this.

Thom Ives
  • 3,642
  • 3
  • 30
  • 29
0
pip install virtualenv

This command worked for me for. This problem that raised to me on Kali Linux.

Sinh Nguyen
  • 4,277
  • 3
  • 18
  • 26