Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Contradiction on supported versions #461

Closed
Bonifacio2 opened this issue Aug 12, 2016 · 9 comments
Closed

Contradiction on supported versions #461

Bonifacio2 opened this issue Aug 12, 2016 · 9 comments

Comments

@Bonifacio2
Copy link

Bonifacio2 commented Aug 12, 2016

README.md says that it supports Python 3.4 while installation.rst, the installation documentation, says Python 3 is not currently supported.

Which one is correct?

@codeadict
Copy link

I will test on 3.4, tested on 3.5 and i'm getting an import error:

File "/home/codeadict/.virtualenvs/cloud-api/bin/locust", line 7, in <module>
    from locust.main import main
  File "/home/codeadict/.virtualenvs/cloud-api/local/lib/python3.5/site-packages/locust/__init__.py", line 1, in <module>
    from core import HttpLocust, Locust, TaskSet, task
ImportError: cannot import name 'HttpLocust'

Will make a fix for it soon

@heyman
Copy link
Member

heyman commented Oct 7, 2016

The latest master should support Python 3, but the latest PyPI release does currently not.

@heyman heyman closed this as completed Oct 7, 2016
@myrinx
Copy link

myrinx commented Feb 17, 2017

Python 3.5.2 via pip3 install does not work unfortunately. Same issue as above.

@cgoldberg
Copy link
Member

@myrinx
please see the comment posted directly before yours. If you install from master, it is compatible with Python 3.

@myrinx
Copy link

myrinx commented Feb 19, 2017

I have done that. I downloaded the git repo (on windows so not git clone) and ran setup.py build install.

This installs everything for python 3, but when running a sample script, I get the message:

Traceback (most recent call last):
File "locust.py", line 1, in
from locust import HttpLocust, TaskSet
File "locust.py", line 1, in
from locust import HttpLocust, TaskSet
ImportError: cannot import name 'HttpLocust'

@myrinx
Copy link

myrinx commented Feb 19, 2017

I've spotted the flaw. when naming the locustfile to use locust.py, it doesn't work...

@heyman
Copy link
Member

heyman commented Feb 20, 2017

@myrinx Ah, yes. We should maybe check for that explicitly and warn+fail, since it has come up a couple of times.

Glad you found it!

@cgoldberg
Copy link
Member

see #546

@nags28
Copy link

nags28 commented Nov 3, 2020

even I am facing the same issue

my python version
python3 --version
Python 3.6.9
pip3 --version
pip 9.0.1 from /usr/lib/python3/dist-packages (python 3.6)

if I check the locust version I am facing the below error

locust -v

Traceback (most recent call last):
File "/usr/local/bin/locust", line 11, in
load_entry_point('locust', 'console_scripts', 'locust')()
File "/locust-task/src/locust/locust/main.py", line 123, in main
docstring, user_classes, shape_class = load_locustfile(locustfile)
File "/locust-task/src/locust/locust/main.py", line 79, in load_locustfile
imported = source.load_module()
File "", line 399, in _check_name_wrapper
File "", line 823, in load_module
File "", line 682, in load_module
File "", line 265, in _load_module_shim
File "", line 684, in _load
File "", line 665, in _load_unlocked
File "", line 678, in exec_module
File "", line 219, in _call_with_frames_removed
File "/locust-task/locustfile.py", line 1, in
from locust import HttpLocust, TaskSet, task, InterruptTaskSet
ImportError: cannot import name 'InterruptTaskSet'

can someone help me to resolve it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants