question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. ItΒ collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot install locust into conda env with python 3.8.0

See original GitHub issue

Describe the bug

Cannot install locust into conda env with python 3.8.0

Steps to reproduce

conda create --name locust8 -y
conda activate locust8
conda install pip
pip install locust

Error log:

(locust8) C:\>conda list
# packages in environment at C:\Users\user\.conda\envs\locust8:
#
# Name                    Version                   Build  Channel
ca-certificates           2019.10.16                    0
certifi                   2019.9.11                py38_0
openssl                   1.1.1d               he774522_3
pip                       19.3.1                   py38_0
python                    3.8.0                hff0d562_1
setuptools                41.6.0                   py38_0
sqlite                    3.30.1               he774522_0
vc                        14.1                 h0510ff6_4
vs2015_runtime            14.16.27012          hf0eaf9b_0
wheel                     0.33.6                   py38_0
wincertstore              0.2                      py38_0


(locust8) C:\>pip install locust
Collecting locust
  Using cached https://files.pythonhosted.org/packages/46/2e/18d4e363e76ec8f407ed018594f474d5669b3bca3977c4c664940fff95d5/locust-0.0.tar.gz
Collecting locustio
  Using cached https://files.pythonhosted.org/packages/56/a6/b63507b1366b2adcad807e154df3d18a4fb00eb0670c5cbcc086f8f235c9/locustio-0.12.2-py2.py3-none-any.whl
Collecting geventhttpclient-wheels==1.3.1.dev2
  Downloading https://files.pythonhosted.org/packages/bc/7f/42f8b4ac6c7ddf606fa69769cef2229a159d4af45a294053198f52586095/geventhttpclient-wheels-1.3.1.dev2.tar.gz (54kB)
     |β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 61kB ...
Collecting gevent>=1.2.2
  Using cached https://files.pythonhosted.org/packages/ed/27/6c49b70808f569b66ec7fac2e78f076e9b204db9cf5768740cff3d5a07ae/gevent-1.4.0.tar.gz
    ERROR: Command errored out with exit status 1:
     command: 'C:\Users\user\.conda\envs\locust8\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\user\\AppData\\Local\\Temp\\2\\pip-install-1y2lm8yx\\gevent\\setup.py'"'"'; __file__='"'"'C:\\Users\\user\\AppData\\Local\\Temp\\2\\pip-install-1y2lm8yx\\gevent\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base 'C:\Users\user\AppData\Local\Temp\2\pip-install-1y2lm8yx\gevent\pip-egg-info'
         cwd: C:\Users\user\AppData\Local\Temp\2\pip-install-1y2lm8yx\gevent\
    Complete output (112 lines):
    Traceback (most recent call last):
      File "C:\Users\user\.conda\envs\locust8\lib\site-packages\setuptools\sandbox.py", line 154, in save_modules
        yield saved
      File "C:\Users\user\.conda\envs\locust8\lib\site-packages\setuptools\sandbox.py", line 195, in setup_context
        yield
      File "C:\Users\user\.conda\envs\locust8\lib\site-packages\setuptools\sandbox.py", line 250, in run_setup
        _execfile(setup_script, ns)
      File "C:\Users\user\.conda\envs\locust8\lib\site-packages\setuptools\sandbox.py", line 45, in _execfile
        exec(code, globals, locals)
      File "C:\Users\user\AppData\Local\Temp\2\easy_install-cnm3v8gt\cffi-1.13.2\setup.py", line 127, in <module>
        HUB_PRIMITIVES = Extension(name="gevent.__hub_primitives",
      File "C:\Users\user\AppData\Local\Temp\2\easy_install-cnm3v8gt\cffi-1.13.2\setup.py", line 105, in uses_msvc
        include_dirs=include_dirs)
      File "C:\Users\user\.conda\envs\locust8\lib\distutils\command\config.py", line 225, in try_compile
        self._compile(body, headers, include_dirs, lang)
      File "C:\Users\user\.conda\envs\locust8\lib\distutils\command\config.py", line 127, in _compile
        src = self._gen_temp_sourcefile(body, headers, lang)
      File "C:\Users\user\.conda\envs\locust8\lib\distutils\command\config.py", line 109, in _gen_temp_sourcefile
        with open(filename, "w") as file:
      File "C:\Users\user\.conda\envs\locust8\lib\site-packages\setuptools\sandbox.py", line 418, in _open
        self._violation("open", path, mode, *args, **kw)
      File "C:\Users\user\.conda\envs\locust8\lib\site-packages\setuptools\sandbox.py", line 407, in _violation
        raise SandboxViolation(operation, args, kw)
    setuptools.sandbox.SandboxViolation: SandboxViolation: open('_configtest.c', 'w') {}

    The package setup script has attempted to modify files on your system
    that are not within the EasyInstall build area, and has been aborted.

    This package cannot be safely installed by EasyInstall, and may not
    support alternate installation locations even if you run its setup
    script by hand.  Please inform the package's author and the EasyInstall
    maintainers to find out if a fix or workaround is available.


    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "C:\Users\user\AppData\Local\Temp\2\pip-install-1y2lm8yx\gevent\setup.py", line 427, in <module>
        run_setup(EXT_MODULES, run_make=_BUILDING)
      File "C:\Users\user\AppData\Local\Temp\2\pip-install-1y2lm8yx\gevent\setup.py", line 328, in run_setup
        setup(
      File "C:\Users\user\.conda\envs\locust8\lib\site-packages\setuptools\__init__.py", line 144, in setup
        _install_setup_requires(attrs)
      File "C:\Users\user\.conda\envs\locust8\lib\site-packages\setuptools\__init__.py", line 139, in _install_setup_requires
        dist.fetch_build_eggs(dist.setup_requires)
      File "C:\Users\user\.conda\envs\locust8\lib\site-packages\setuptools\dist.py", line 717, in fetch_build_eggs
        resolved_dists = pkg_resources.working_set.resolve(
      File "C:\Users\user\.conda\envs\locust8\lib\site-packages\pkg_resources\__init__.py", line 780, in resolve
        dist = best[req.key] = env.best_match(
      File "C:\Users\user\.conda\envs\locust8\lib\site-packages\pkg_resources\__init__.py", line 1065, in best_match
        return self.obtain(req, installer)
      File "C:\Users\user\.conda\envs\locust8\lib\site-packages\pkg_resources\__init__.py", line 1077, in obtain
        return installer(requirement)
      File "C:\Users\user\.conda\envs\locust8\lib\site-packages\setuptools\dist.py", line 787, in fetch_build_egg
        return cmd.easy_install(req)
      File "C:\Users\user\.conda\envs\locust8\lib\site-packages\setuptools\command\easy_install.py", line 679, in easy_install
        return self.install_item(spec, dist.location, tmpdir, deps)
      File "C:\Users\user\.conda\envs\locust8\lib\site-packages\setuptools\command\easy_install.py", line 705, in install_item
        dists = self.install_eggs(spec, download, tmpdir)
      File "C:\Users\user\.conda\envs\locust8\lib\site-packages\setuptools\command\easy_install.py", line 890, in install_eggs
        return self.build_and_install(setup_script, setup_base)
      File "C:\Users\user\.conda\envs\locust8\lib\site-packages\setuptools\command\easy_install.py", line 1158, in build_and_install
        self.run_setup(setup_script, setup_base, args)
      File "C:\Users\user\.conda\envs\locust8\lib\site-packages\setuptools\command\easy_install.py", line 1144, in run_setup
        run_setup(setup_script, args)
      File "C:\Users\user\.conda\envs\locust8\lib\site-packages\setuptools\sandbox.py", line 253, in run_setup
        raise
      File "C:\Users\user\.conda\envs\locust8\lib\contextlib.py", line 131, in __exit__
        self.gen.throw(type, value, traceback)
      File "C:\Users\user\.conda\envs\locust8\lib\site-packages\setuptools\sandbox.py", line 195, in setup_context
        yield
      File "C:\Users\user\.conda\envs\locust8\lib\contextlib.py", line 131, in __exit__
        self.gen.throw(type, value, traceback)
      File "C:\Users\user\.conda\envs\locust8\lib\site-packages\setuptools\sandbox.py", line 166, in save_modules
        saved_exc.resume()
      File "C:\Users\user\.conda\envs\locust8\lib\site-packages\setuptools\sandbox.py", line 141, in resume
        six.reraise(type, exc, self._tb)
      File "C:\Users\user\.conda\envs\locust8\lib\site-packages\setuptools\_vendor\six.py", line 685, in reraise
        raise value.with_traceback(tb)
      File "C:\Users\user\.conda\envs\locust8\lib\site-packages\setuptools\sandbox.py", line 154, in save_modules
        yield saved
      File "C:\Users\user\.conda\envs\locust8\lib\site-packages\setuptools\sandbox.py", line 195, in setup_context
        yield
      File "C:\Users\user\.conda\envs\locust8\lib\site-packages\setuptools\sandbox.py", line 250, in run_setup
        _execfile(setup_script, ns)
      File "C:\Users\user\.conda\envs\locust8\lib\site-packages\setuptools\sandbox.py", line 45, in _execfile
        exec(code, globals, locals)
      File "C:\Users\user\AppData\Local\Temp\2\easy_install-cnm3v8gt\cffi-1.13.2\setup.py", line 127, in <module>
        HUB_PRIMITIVES = Extension(name="gevent.__hub_primitives",
      File "C:\Users\user\AppData\Local\Temp\2\easy_install-cnm3v8gt\cffi-1.13.2\setup.py", line 105, in uses_msvc
        include_dirs=include_dirs)
      File "C:\Users\user\.conda\envs\locust8\lib\distutils\command\config.py", line 225, in try_compile
        self._compile(body, headers, include_dirs, lang)
      File "C:\Users\user\.conda\envs\locust8\lib\distutils\command\config.py", line 127, in _compile
        src = self._gen_temp_sourcefile(body, headers, lang)
      File "C:\Users\user\.conda\envs\locust8\lib\distutils\command\config.py", line 109, in _gen_temp_sourcefile
        with open(filename, "w") as file:
      File "C:\Users\user\.conda\envs\locust8\lib\site-packages\setuptools\sandbox.py", line 418, in _open
        self._violation("open", path, mode, *args, **kw)
      File "C:\Users\user\.conda\envs\locust8\lib\site-packages\setuptools\sandbox.py", line 407, in _violation
        raise SandboxViolation(operation, args, kw)
    setuptools.sandbox.SandboxViolation: SandboxViolation: open('_configtest.c', 'w') {}

    The package setup script has attempted to modify files on your system
    that are not within the EasyInstall build area, and has been aborted.

    This package cannot be safely installed by EasyInstall, and may not
    support alternate installation locations even if you run its setup
    script by hand.  Please inform the package's author and the EasyInstall
    maintainers to find out if a fix or workaround is available.

    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:8 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
ecc256commented, Nov 8, 2019

Found the root issue, solution is here:

Basically, the install sequence should be:

pip install git+git://github.com/gevent/gevent@master
pip install git+git://github.com/gwik/geventhttpclient@master
pip install locust

Edited The following will do too:

pip install git+git://github.com/gevent/gevent@master
pip install locust
0reactions
cyberwcommented, Nov 8, 2019

@ecc256 Thanks!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Installation β€” Locust 2.14.0 documentation
Installation ΒΆ. Install Python (3.7 or later). Install the package (check the wiki if the installation fails).
Read more >
Not able to install Locust on Mac - Stack Overflow
I am installing Locust on my Mac with the following command (as per the docs https://docs.locust.io/en/2.8.1/installation.html):.
Read more >
Locust - :: Anaconda.org
Locust is an easy-to-use, distributed, user load testing tool. It is intended for load-testing web sites (or other systems) and figuring out how...
Read more >
install latest python on linux ubuntu Code Example - Code Grepper
sudo apt install python3.8.
Read more >
How to Install Python on Windows 11 - YouTube
In this video I an going to show How to Download and Install Python 3.10 on Windows 11. Setting up your Windows 11...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found