Trouble creating virtual environment for Zope server installation in linux environment
1) We are facing trouble installing zope with virtual environment when executed we are facing the below error
when executing the shown command
virtualenv --no-site-packages Zope
Traceback (most recent call last):
File "/bin/virtualenv", line 5, in <module>
from pkg_resources import load_entry_point
File "/usr/lib/python2.7/site-packages/pkg_resources/__init__.py", line 3084, in <module>
@_call_aside
File "/usr/lib/python2.7/site-packages/pkg_resources/__init__.py", line 3070, in _call_aside
f(*args, **kwargs)
File "/usr/lib/python2.7/site-packages/pkg_resources/__init__.py", line 3097, in _initialize_master_working_set
working_set = WorkingSet._build_master()
File "/usr/lib/python2.7/site-packages/pkg_resources/__init__.py", line 651, in _build_master
ws.require(__requires__)
File "/usr/lib/python2.7/site-packages/pkg_resources/__init__.py", line 952, in require
needed = self.resolve(parse_requirements(requirements))
File "/usr/lib/python2.7/site-packages/pkg_resources/__init__.py", line 839, in resolve
raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'virtualenv==20.0.21' distribution was not found and is required by the application
2) We were unable to install virtualenv first with easy_install so we did the following
3) Installed pip package with yum instal python-pip
4) Downaload virtualenv using pip command. Output is shown below
/bin/python -m pip install --user virtualenv
Collecting virtualenv
Downloading
https://files.pythonhosted.org/packages/57/6e/a13442adf18bada682f88f55638cd43cc7a39c3e00fdcf898ca4ceaeb682/virtualenv-20.0.21-py2.py3-none-any.whl (4.7MB)
100% |████████████████████████████████| 4.7MB 174kB/s
Requirement already satisfied (use --upgrade to upgrade): six<2,>=1.9.0 in /usr/lib/python2.7/site-packages (from virtualenv)
Collecting distlib<1,>=0.3.0 (from virtualenv)
Downloading
https://files.pythonhosted.org/packages/7d/29/694a3a4d7c0e1aef76092e9167fbe372e0f7da055f5dcf4e1313ec21d96a/distlib-0.3.0.zip (571kB)
100% |████████████████████████████████| 573kB 1.7MB/s
Collecting importlib-metadata<2,>=0.12; python_version < "3.8" (from virtualenv)
Downloading
https://files.pythonhosted.org/packages/ad/e4/891bfcaf868ccabc619942f27940c77a8a4b45fd8367098955bb7e152fb1/importlib_metadata-1.6.0-py2.py3-none-any.whlCollecting appdirs<2,>=1.4.3 (from virtualenv)
Downloading
https://files.pythonhosted.org/packages/3b/00/2344469e2084fb287c2e0b57b72910309874c3245463acd6cf5e3db69324/appdirs-1.4.4-py2.py3-none-any.whlCollecting importlib-resources<2,>=1.0; python_version < "3.7" (from virtualenv)
Downloading
https://files.pythonhosted.org/packages/7f/2d/88f166bcaadc09d9fdbf1c336ad118e01b7fe1155e15675e125be2ff1899/importlib_resources-1.5.0-py2.py3-none-any.whlCollecting filelock<4,>=3.0.0 (from virtualenv)
Downloading
https://files.pythonhosted.org/packages/14/ec/6ee2168387ce0154632f856d5cc5592328e9cf93127c5c9aeca92c8c16cb/filelock-3.0.12.tar.gzCollecting contextlib2<1,>=0.6.0; python_version < "3.3" (from virtualenv)
Downloading
https://files.pythonhosted.org/packages/85/60/370352f7ef6aa96c52fb001831622f50f923c1d575427d021b8ab3311236/contextlib2-0.6.0.post1-py2.py3-none-any.whlCollecting pathlib2<3,>=2.3.3; python_version < "3.4" and sys_platform != "win32" (from virtualenv)
Downloading
https://files.pythonhosted.org/packages/e9/45/9c82d3666af4ef9f221cbb954e1d77ddbb513faf552aea6df5f37f1a4859/pathlib2-2.3.5-py2.py3-none-any.whlCollecting zipp>=0.5 (from importlib-metadata<2,>=0.12; python_version < "3.8"->virtualenv)
Downloading
https://files.pythonhosted.org/packages/ce/8c/2c5f7dc1b418f659d36c04dec9446612fc7b45c8095cc7369dd772513055/zipp-3.1.0.tar.gz Running setup.py (path:/tmp/pip-build-nR0Qs9/zipp/setup.py) egg_info for package zipp produced metadata for project name unknown. Fix your #egg=zipp fragments.
Collecting configparser>=3.5; python_version < "3" (from importlib-metadata<2,>=0.12; python_version < "3.8"->virtualenv)
Downloading
https://files.pythonhosted.org/packages/e5/7c/d4ccbcde76b4eea8cbd73b67b88c72578e8b4944d1270021596e80b13deb/configparser-5.0.0.tar.gz (75kB)
100% |████████████████████████████████| 81kB 7.8MB/s
Running setup.py (path:/tmp/pip-build-nR0Qs9/configparser/setup.py) egg_info for package configparser produced metadata for project name unknown. Fix your #egg=configparser fragments.
Collecting singledispatch; python_version < "3.4" (from importlib-resources<2,>=1.0; python_version < "3.7"->virtualenv)
Downloading
https://files.pythonhosted.org/packages/c5/10/369f50bcd4621b263927b0a1519987a04383d4a98fb10438042ad410cf88/singledispatch-3.4.0.3-py2.py3-none-any.whlCollecting typing; python_version < "3.5" (from importlib-resources<2,>=1.0; python_version < "3.7"->virtualenv)
Downloading
https://files.pythonhosted.org/packages/22/30/64ca29543375759dc589ade14a6cd36382abf2bec17d67de8481bc9814d7/typing-3.7.4.1-py2-none-any.whlCollecting scandir; python_version < "3.5" (from pathlib2<3,>=2.3.3; python_version < "3.4" and sys_platform != "win32"->virtualenv)
Downloading
https://files.pythonhosted.org/packages/df/f5/9c052db7bd54d0cbf1bc0bb6554362bba1012d03e5888950a4f5c5dadc4e/scandir-1.10.0.tar.gzInstalling collected packages: distlib, contextlib2, unknown, scandir, pathlib2, unknown, importlib-metadata, appdirs, singledispatch, typing, importlib-resources, filelock, virtualenv
Running setup.py install for distlib ... done
Running setup.py install for unknown ... done
Running setup.py install for scandir ... done
Running setup.py install for unknown ... done
Running setup.py install for filelock ... done
Successfully installed appdirs contextlib2 distlib filelock importlib-metadata importlib-resources pathlib2 scandir singledispatch typing unknown unknown virtualenv
You are using pip version 8.1.2, however version 20.1.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
5) Then we installed virtualenv using easy_install and it did not work and gave below error
sudo /usr/bin/easy_install virtualenv
Searching for virtualenv
Best match: virtualenv 20.0.21
Adding virtualenv 20.0.21 to easy-install.pth file
Installing virtualenv script to /usr/bin
Using /root/.local/lib/python2.7/site-packages
Processing dependencies for virtualenv
Searching for zipp>=0.4
Reading
https://pypi.python.org/simple/zipp/Best match: zipp 3.1.0
Downloading
https://files.pythonhosted.org/packages/ce/8c/2c5f7dc1b418f659d36c04dec9446612fc7b45c8095cc7369dd772513055/zipp-3.1.0.tar.gz#sha256=c599e4d75c98f6798c509911d08a22e6c021d074469042177c8c86fb92eefd96Processing zipp-3.1.0.tar.gz
Writing /tmp/easy_install-9dI7F0/zipp-3.1.0/setup.cfg
Running zipp-3.1.0/setup.py -q bdist_egg --dist-dir /tmp/easy_install-9dI7F0/zipp-3.1.0/egg-dist-tmp-8LBG0c
warning: install_lib: 'build/lib' does not exist -- no Python modules to install
zip_safe flag not set; analyzing archive contents...
Moving UNKNOWN-0.0.0-py2.7.egg to /usr/lib/python2.7/site-packages
Adding UNKNOWN 0.0.0 to easy-install.pth file
Installed /usr/lib/python2.7/site-packages/UNKNOWN-0.0.0-py2.7.egg
error: The 'zipp>=0.4' distribution was not found and is required by importlib-resources
6) So we upgraded pip package and installed virtual env again
/bin/python -m pip install --upgrade pip
Collecting pip
Downloading
https://files.pythonhosted.org/packages/43/84/23ed6a1796480a6f1a2d38f2802901d078266bda38388954d01d3f2e821d/pip-20.1.1-py2.py3-none-any.whl (1.5MB)
100% |████████████████████████████████| 1.5MB 600kB/s
Installing collected packages: pip
Found existing installation: pip 8.1.2
Uninstalling pip-8.1.2:
Successfully uninstalled pip-8.1.2
Successfully installed pip-20.1.1
/bin/python -m pip install --user virtualenv
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip, can be found at
https://pip.pypa.io/en/latest/development/release-process/#python-2-supportRequirement already satisfied: virtualenv in ./.local/lib/python2.7/site-packages (20.0.21)
Requirement already satisfied: distlib<1,>=0.3.0 in ./.local/lib/python2.7/site-packages (from virtualenv) (0.3.0)
Requirement already satisfied: filelock<4,>=3.0.0 in ./.local/lib/python2.7/site-packages (from virtualenv) (3.0.12)
Requirement already satisfied: importlib-resources<2,>=1.0; python_version < "3.7" in ./.local/lib/python2.7/site-packages (from virtualenv) (1.5.0)
Requirement already satisfied: six<2,>=1.9.0 in /usr/lib/python2.7/site-packages (from virtualenv) (1.9.0)
Requirement already satisfied: pathlib2<3,>=2.3.3; python_version < "3.4" and sys_platform != "win32" in ./.local/lib/python2.7/site-packages (from virtualenv) (2.3.5)
Requirement already satisfied: contextlib2<1,>=0.6.0; python_version < "3.3" in ./.local/lib/python2.7/site-packages (from virtualenv) (0.6.0.post1)
Requirement already satisfied: appdirs<2,>=1.4.3 in ./.local/lib/python2.7/site-packages (from virtualenv) (1.4.4)
Requirement already satisfied: importlib-metadata<2,>=0.12; python_version < "3.8" in ./.local/lib/python2.7/site-packages (from virtualenv) (1.6.0)
Collecting zipp>=0.4; python_version < "3.8"
Downloading zipp-1.2.0-py2.py3-none-any.whl (4.8 kB)
Requirement already satisfied: singledispatch; python_version < "3.4" in ./.local/lib/python2.7/site-packages (from importlib-resources<2,>=1.0; python_version < "3.7"->virtualenv) (3.4.0.3)
Requirement already satisfied: typing; python_version < "3.5" in ./.local/lib/python2.7/site-packages (from importlib-resources<2,>=1.0; python_version < "3.7"->virtualenv) (3.7.4.1)
Requirement already satisfied: scandir; python_version < "3.5" in ./.local/lib/python2.7/site-packages (from pathlib2<3,>=2.3.3; python_version < "3.4" and sys_platform != "win32"->virtualenv) (1.10.0)
Collecting configparser>=3.5; python_version < "3"
Downloading configparser-4.0.2-py2.py3-none-any.whl (22 kB)
Installing collected packages: zipp, configparser
Successfully installed configparser-4.0.2 zipp-1.2.0
7) We then executed virtualenv with easy_install it don't thow error
sudo /usr/bin/easy_install virtualenv
Searching for virtualenv
Best match: virtualenv 20.0.21
Adding virtualenv 20.0.21 to easy-install.pth file
Installing virtualenv script to /usr/bin
Using /root/.local/lib/python2.7/site-packages
Processing dependencies for virtualenv
Finished processing dependencies for virtualenv
8) Even after this we are not able to proceed further
virtualenv --no-site-packages Zope
Traceback (most recent call last):
File "/bin/virtualenv", line 5, in <module>
from pkg_resources import load_entry_point
File "/usr/lib/python2.7/site-packages/pkg_resources/__init__.py", line 3084, in <module>
@_call_aside
File "/usr/lib/python2.7/site-packages/pkg_resources/__init__.py", line 3070, in _call_aside
f(*args, **kwargs)
File "/usr/lib/python2.7/site-packages/pkg_resources/__init__.py", line 3097, in _initialize_master_working_set
working_set = WorkingSet._build_master()
File "/usr/lib/python2.7/site-packages/pkg_resources/__init__.py", line 651, in _build_master
ws.require(__requires__)
File "/usr/lib/python2.7/site-packages/pkg_resources/__init__.py", line 952, in require
needed = self.resolve(parse_requirements(requirements))
File "/usr/lib/python2.7/site-packages/pkg_resources/__init__.py", line 839, in resolve
raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'virtualenv==20.0.21' distribution was not found and is required by the application
Thank you,