Python Forum
hypothesis 6.46.2 requires python3.7 or later
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
hypothesis 6.46.2 requires python3.7 or later
#1
I run the code using charm crypto for a project, python3.6 and Ununtu18 which shows me an error indicating a hypothesis and exception error.
hypothesis 6.46.2 requires python3.7 or later
The hypothesis is an advanced library in python used for testing
Where I had installed these libraries
pyparsing==2.1.5
hypothesis
pytest

The error in setup.py files or elsewhere like it can happen if the packaging toolchain is older than python require how to solve it.
from hypothesis.strategies import text, composite, sampled_from, characters, one_of, integers
from functools import partial
Error:
/usr/bin/python3.6 /home/ali/Downloads/charm-dev/charm/toolbox/policy_expression_spec.py Traceback (most recent call last): File "/home/ali/Downloads/charm-dev/charm/toolbox/policy_expression_spec.py", line 1, in <module> from hypothesis.strategies import text, composite, sampled_from, characters, one_of, integers File "/usr/local/lib/python3.6/dist-packages/hypothesis-6.46.2-py3.6.egg/hypothesis/__init__.py", line 18, in <module> import hypothesis._error_if_old # noqa # imported for side-effect of nice error File "/usr/local/lib/python3.6/dist-packages/hypothesis-6.46.2-py3.6.egg/hypothesis/_error_if_old.py", line 23, in <module> raise Exception(message.format(__version__)) Exception: Hypothesis 6.46.2 requires Python 3.7 or later. This can only happen if your packaging toolchain is older than python_requires. See https://packaging.python.org/guides/distributing-packages-using-setuptools/ Error in sys.excepthook: Traceback (most recent call last): File "/usr/lib/python3/dist-packages/apport_python_hook.py", line 62, in apport_excepthook if not enabled(): File "/usr/lib/python3/dist-packages/apport_python_hook.py", line 24, in enabled import re File "/usr/lib/python3.6/re.py", line 142, in <module> class RegexFlag(enum.IntFlag): AttributeError: module 'enum' has no attribute 'IntFlag' Original exception was: Traceback (most recent call last): File "/home/ali/Downloads/charm-dev/charm/toolbox/policy_expression_spec.py", line 1, in <module> from hypothesis.strategies import text, composite, sampled_from, characters, one_of, integers File "/usr/local/lib/python3.6/dist-packages/hypothesis-6.46.2-py3.6.egg/hypothesis/__init__.py", line 18, in <module> import hypothesis._error_if_old # noqa # imported for side-effect of nice error File "/usr/local/lib/python3.6/dist-packages/hypothesis-6.46.2-py3.6.egg/hypothesis/_error_if_old.py", line 23, in <module> raise Exception(message.format(__version__)) Exception: Hypothesis 6.46.2 requires Python 3.7 or later. This can only happen if your packaging toolchain is older than python_requires. See https://packaging.python.org/guides/distributing-packages-using-setuptools/
Reply
#2
The message is very clear,you are using Python 3.6 and Hypothesis requires Python 3.7 or later.
Install a new Python version eg now Python 3.10.5.
Many libraries start drooping support for Python 3.6.
ndc85430 likes this post
Reply
#3
for the new version, of python I know it works I know how to solve it in python3.6
Reply
#4
Which Linux-Distribution are you using?
Debian has never used Python 3.6 in any release.

On Linux, you have the problem, that often a major version is fixed and could not be replaced by a newer version, but you can use pyenv to build your own Python versions, which are isolated from the rest of your system.

https://realpython.com/intro-to-pyenv/

If you like, you can also compile alpha/beta Versions like Python 3.11.0b3
Almost dead, but too lazy to die: https://sourceserver.info
All humans together. We don't need politicians!
Reply
#5
I am using Ubuntu 18 and python 3.6 but if I change it new python version then the problem is with charm and PBC and PyPBC need to install for the new version and other problems are charm-based implementation https://github.com/JHUISI/charm/tree/dev/charm/test of some code support python3.6 and some code python3.7 or above.
Reply
#6
Whenever python is changed, python packages that are not included with the distribution must be replaced.
This should be expected, as there are as of today 383,326 packages available and it wouldn't be practical nor wise to do so.

Re-Installing packages doesn't take long using pip.

Note: Commands shown are for Linux, may be different for MSwindows

You can expedite this by having a requirements file pip freeze > requirements.txt available prior to removing old python version.

Then after new version is installed and version selected, you can run pip install -r requirements.txt which will reinstall all packages (including the same version number as before).

DeaD_Eye's suggestion of installing pyenv is the way to go (In my opinion). I use it in combination with a virtual environment for every new project I create.
Reply
#7
@DeaD_EyE and @Larz60+ sure thanks you for your time and suggestion.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Using python to execute app or cmd that requires admin credentials thewolf 0 2,106 Mar-05-2021, 08:15 PM
Last Post: thewolf
  Making .exe file that requires access to text and html files ClassicalSoul 0 1,579 Apr-23-2020, 05:03 PM
Last Post: ClassicalSoul
  Gnuradio python3 is not compatible python3 xmlrpc library How Can I Fix İt ? muratoznnnn 3 4,897 Nov-07-2019, 05:47 PM
Last Post: DeaD_EyE
  bksp() requires no arguments (one given) gdog1102 3 5,301 Oct-28-2016, 04:50 PM
Last Post: gdog1102

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020