Меню Закрыть

Typeerror an integer is required

Содержание

Traceback (most recent call last):
File «C:/Users/x/PycharmProjects/untitled12/zmeika big game.py», line 135, in
gameOver()
File «C:/Users/x/PycharmProjects/untitled12/zmeika big game.py», line 51, in gameOver
playSurface.blit(gaOSurface,gaORectangular,gaOtSurface,gaotRectangular)
TypeError: an integer is required (got type pygame.Rect)

P.S Я пытался добавить предложения содержимого которого сколько время в игре вы проверили , line 47 и появилась вот такая ошибка.

Я новичок в питоне и колбе. Я пытаюсь проделать свой путь через учебник по фляге в http://blog.miguelgrinberg.com/post/the-flask-mega-tutorial-part-i-hello-world. Я столкнулся с ошибкой, которую не могу понять. Я исчерпывающе (я думаю) искал решение, но я не могу найти тот, который подходит для моей проблемы. Я удалил и снова установил колбу. Я даже создал новый venv и начал все сначала, но ничего не сработало.

Я пытаюсь создать простое приложение для веб-форм. Я создал такую ​​форму, как:

Когда я импортирую LoginForm, я получаю сообщение об ошибке

Полный стек: здесь

Любая помощь приветствуется — это сводит меня с ума!

Это ошибка сборки пакета babel 2.0 в индексе пакета python

Подводя итог, замаскированный файл babel/global.dat включен в пакет, и это не может быть прочитано python 3, потому что он был создан script под управлением python 2.

Я решил это, установив из github вместо PyPI, как это было предложено в проблеме github:

Я использую Python 3.4 для Windows, и я получил ту же самую точную ошибку.

Что я сделал для решения проблемы, так это удаление модуля babel для фляжки следующим образом:

Модуль babel по-прежнему импортируется правильно:

Единственная проблема заключается в том, что я не понимаю причины этого.

Получил эту ту же самую проблему примерно в то же время, что и вы, — я был очень взволнован, увидев на ней страницу stackoverflow, чтобы увидеть ее без ответа. Кажется, я нашел исправление, но я предостерег его от факта, что я ни в коем случае не эксперт и завтра обнаруживаю, что это сломало что-то еще.

Корни в зависимостях core.py, я обнаружил, что в зависимости от версии python, которую вы запускаете, /babel/ _compat.py импортирует либо cPickle, либо pickle, и то, что core.py импортирует как pickle.

Я изменил строку 22 в /babel/ _compat.py из

и вот и все работающее.

Опять же, это может сломать много вещей, о которых я не знаю, но из того, что я прочитал, похоже, что cPickle быстрее, поэтому это просто приносит в жертву скорость и не должно изменять функциональность. Если вы просто следуете руководству по фляге, я сомневаюсь, что это будет проблемой.

Comments

Copy link Quote reply

sl4vkek commented Jun 8, 2019

When i compile any script using pyinstaller i get TypeError: an integer is required (got type bytes)

i tried both with and without UPX, still the same error, i even tried installing the latest dev builds and it’s still the same error.

This comment has been minimized.

Copy link Quote reply

sl4vkek commented Jun 8, 2019

Note that i was using Python 3.8.

This comment has been minimized.

Copy link Quote reply

tirkarthi commented Jun 8, 2019

Seems like this is constructing a code object and could be due to PEP 570 implementation : python/cpython#12701

This comment has been minimized.

Copy link Quote reply

Hamera >Oct 16, 2019

I have the exact same error, using python3.8.0 and pyinstaller 3.5

This comment has been minimized.

Copy link Quote reply

gresavage commented Oct 16, 2019

I have this same issue. Various other threads claim this was fixed but it definitely persists. See below
#4440

This comment has been minimized.

Copy link Quote reply

msacchetin commented Oct 18, 2019

Me too. Exactly same error. Python 3.8.0 and PyInstaller 3.5

This comment has been minimized.

Copy link Quote reply

nathonfowlie commented Oct 20, 2019

I’m also seeing this error. I’m using pyenv 1.2.13 to create a python 3.8.0 environment ( sudo env PYTHON_CONFIGURE_OPTS="—enable-shared" pyenv install 3.8.0 ), and PyInstaller 3.5 on Mac OSX High Sierra.

Not sure if it helps at all, but the issue also occurs when UPX is installed.

This comment has been minimized.

Copy link Quote reply

Читайте также:  Launcher для менеджера браузеров что это

epcit commented Oct 21, 2019

请问你解决了?我也是Python3.8 +3.5报同样的错误,哪怕最简单的 print "hell oworld" 编译为exe都报错
10668 INFO: Warnings written to E:exec estuildhelloworldwarn-helloworld.txt
10729 INFO: Graph cross-reference written to E:exec estuildhelloworldxref-helloworld.html
10754 INFO: checking PYZ
10755 INFO: Building PYZ because PYZ-00.toc is non existent
10755 INFO: Building PYZ (ZlibArchive) E:exec estuildhelloworldPYZ-00.pyz
Traceback (most recent call last):
File "c:usersadministratorappdatalocalprogramspythonpython38lib
unpy.py", line 192, in run_module_as_main
return
run_code(code, main_globals, None,
File "c:usersadministratorappdatalocalprogramspythonpython38lib
unpy.py", line 85, in
run_code
exec(code, run_globals)
File "C:UsersAdministratorAppDataLocalProgramsPythonPython38Scriptspyinstaller.exe_
main.py", line 7, in
File "c:usersadministratorappdatalocalprogramspythonpython38libsite-packagesPyInstaller_main.py", line 111, in run
run_build(pyi_config, spec_file, **vars(args))
File "c:usersadministratorappdatalocalprogramspythonpython38libsite-packagesPyInstaller_main.py", line 63, in run_build
PyInstaller.building.build_main.main(pyi_config, spec_file, **kwargs)
File "c:usersadministratorappdatalocalprogramspythonpython38libsite-packagesPyInstalleruildinguild_main.py", line 844, in main
build(specfile, kw.get(‘distpath’), kw.get(‘workpath’), kw.get(‘clean_build’))
File "c:usersadministratorappdatalocalprogramspythonpython38libsite-packagesPyInstalleruildinguild_main.py", line 791, in build
exec(code, spec_namespace)
File "E:exec esthelloworld.spec", line 18, in
pyz = PYZ(a.pure, a.zipped_data,
File "c:usersadministratorappdatalocalprogramspythonpython38libsite-packagesPyInstalleruildingapi.py", line 98, in init
self.postinit()
File "c:usersadministratorappdatalocalprogramspythonpython38libsite-packagesPyInstalleruildingdatastruct.py", line 158, in postinit
self.assemble()
File "c:usersadministratorappdatalocalprogramspythonpython38libsite-packagesPyInstalleruildingapi.py", line 128, in assemble
self.code_dict = <
File "c:usersadministratorappdatalocalprogramspythonpython38libsite-packagesPyInstalleruildingapi.py", line 129, in
key: strip_paths_in_code(code)
File "c:usersadministratorappdatalocalprogramspythonpython38libsite-packagesPyInstalleruildingutils.py", line 652, in strip_paths_in_code
consts = tuple(
File "c:usersadministratorappdatalocalprogramspythonpython38libsite-packagesPyInstalleruildingutils.py", line 653, in
strip_paths_in_code(const_co, new_filename)
File "c:usersadministratorappdatalocalprogramspythonpython38libsite-packagesPyInstalleruildingutils.py", line 660, in strip_paths_in_code
return code_func(co.co_argcount, co.co_kwonlyargcount, co.co_nlocals, co.co_stacksize,
TypeError: an integer is required (got type bytes)

This comment has been minimized.

Copy link Quote reply

shuax commented Oct 25, 2019

I have the same problem with Python 3.8

This comment has been minimized.

Copy link Quote reply

shuax commented Oct 25, 2019

pip install https://github.com/pyinstaller/pyinstaller/archive/develop.tar.gz

Direct install the latest version can compatible with python 3.8

This comment has been minimized.

Copy link Quote reply

tinybug commented Oct 27, 2019

use python 3.7.5 is ok.

This comment has been minimized.

Copy link Quote reply

Danixu commented Oct 27, 2019

Same here, but fixed with latest development version provided by shuax.

This comment has been minimized.

Copy link Quote reply

Lethiathan commented Oct 31, 2019

pip install https://github.com/pyinstaller/pyinstaller/archive/develop.tar.gz

Direct install the latest version can compatible with python 3.8

Thank you!

This comment has been minimized.

Copy link Quote reply

odi1n commented Nov 1, 2019

This comment has been minimized.

Copy link Quote reply

LucasMoeris commented Nov 3, 2019

pip install https://github.com/pyinstaller/pyinstaller/archive/develop.tar.gz
Direct install the latest version can compatible with python 3.8

Thank you @shuax , it worked! I thought that the error was caused by the pickled file that would have to be somehow "linked", but actually it’s enough to just put them together in the same directory. Thank you again.

This comment has been minimized.

Copy link Quote reply

clevertension commented Nov 4, 2019

pip install https://github.com/pyinstaller/pyinstaller/archive/develop.tar.gz

Direct install the latest version can compatible with python 3.8

Thank you @shuax , it is ok

This comment has been minimized.

Copy link Quote reply

ghost commented Nov 11, 2019

pip install https://github.com/pyinstaller/pyinstaller/archive/develop.tar.gz

Instalación directa, la última versión puede ser compatible con Python 3.8

This comment has been minimized.

Copy link Quote reply

Reelix commented Nov 11, 2019

Seeing as how the dev version currently fixes this error that everyone with Python 3.8 will come across, it should probably be released as soon as possible.

This comment has been minimized.

Copy link Quote reply

ghazias commented Nov 12, 2019

Seeing as how the dev version currently fixes this error that everyone with Python 3.8 will come across, it should probably be released as soon as possible.

Fortunately, until then, it’s not too difficult to find this thread.

This comment has been minimized.

Copy link Quote reply

CloutProject commented Nov 16, 2019

pip install https://github.com/pyinstaller/pyinstaller/archive/develop.tar.gz

Direct install the latest version can compatible with python 3.8

thanks a lot man!

This comment has been minimized.

Copy link Quote reply

htgoebel commented Nov 16, 2019

Closing as invalid. Python 3.8 is not yet supported.

This comment has been minimized.

Copy link Quote reply

Reelix commented Nov 16, 2019

@ghazias I guess this thread will now be a bit harder to find with it being closed, and the question marked as invalid and not supported, even though the archived version supports it :p

Читайте также:  Что написать в эфир друг вокруг

This comment has been minimized.

Copy link Quote reply

mhucka commented Nov 17, 2019

For anyone coming here experiencing this problem even if they are not running Python 3.8, I wanted to mention that I experience this same error with Python 3.7.4 on a macOS 10.13 system. Similarly to other people above, the problem goes away if I install the dev version as suggested by shuax above.

This comment has been minimized.

Copy link Quote reply

truekonrads commented Nov 18, 2019

Closing as invalid. Python 3.8 is not yet supported.

Hello, can I perhaps suggest that this gets tagged as "3.8 defects" rather than close outright. As a maintainer/owner you can do of course whatever you want, but closing a defect for what is a likely common issue for many perhaps could be reconsidered?

This comment has been minimized.

Copy link Quote reply

truekonrads commented Nov 18, 2019

This comment has been minimized.

Copy link Quote reply

muhibraza commented Nov 18, 2019

pip install https://github.com/pyinstaller/pyinstaller/archive/develop.tar.gz

Direct install the latest version can compatible with python 3.8

Worked like a charm!

This comment has been minimized.

Copy link Quote reply

H4CKY54CK commented Nov 21, 2019 •

Seeing the same TypeError as everyone else after upgrading Python to 3.8 from 3.7.5. Fixed with latest dev version. Windows user, so had to modify it to:

To some, it may seem obvious to change the extension. I wouldn’t have thought of it a few months ago, though.

This comment has been minimized.

Copy link Quote reply

nekolr commented Nov 26, 2019

Seeing the same TypeError as everyone else after upgrading Python to 3.8 from 3.7.5. Fixed with latest dev version. Windows user, so had to modify it to:

To some, it may seem obvious to change the extension. I wouldn’t have thought of it a few months ago, though.

This comment has been minimized.

Copy link Quote reply

wuyuansushen commented Nov 29, 2019

pip install https://github.com/pyinstaller/pyinstaller/archive/develop.tar.gz

Direct install the latest version can compatible with python 3.8

Thanks very much.I hope this newest version could be uploaded to PYPI(pip) as soon as possibble!Thanks

This comment has been minimized.

Copy link Quote reply

Lamarcke commented Nov 30, 2019

pip install https://github.com/pyinstaller/pyinstaller/archive/develop.tar.gz

Direct install the latest version can compatible with python 3.8

Huge thanks, this helped a lot!

This comment has been minimized.

Copy link Quote reply

CryptoGnome commented Dec 3, 2019

pip install https://github.com/pyinstaller/pyinstaller/archive/develop.tar.gz

Direct install the latest version can compatible with python 3.8

This comment has been minimized.

Copy link Quote reply

uriielfl commented Dec 4, 2019

pip install https://github.com/pyinstaller/pyinstaller/archive/develop.tar.gz

Direct install the latest version can compatible with python 3.8

Thank you so much, bro! This was giving me too much headache since 3 months ago!

This comment has been minimized.

Copy link Quote reply

gtrak commented Dec 4, 2019 •

You can install direct from a git hash if you’d rather not float over develop:
pip install git+git://github.com/pyinstaller/pyinstaller.git@9dd34bdfbaeaa4e0459bd3051d1caf0c7d75073f

Latest as of this writing:
9dd34bd

This comment has been minimized.

Copy link Quote reply

Letlaka commented Dec 8, 2019

pip install https://github.com/pyinstaller/pyinstaller/archive/develop.tar.gz

Direct install the latest version can compatible with python 3.8

This also solved my problem

This comment has been minimized.

Copy link Quote reply

Sae-stack commented Dec 12, 2019

Thanks you! this solve my issue

This comment has been minimized.

Copy link Quote reply

TylerGubala commented Dec 13, 2019

Disappointing that this was closed as it is the first thing I ran into on Python 3.8.

pip install https://github.com/pyinstaller/pyinstaller/archive/develop.tar.gz

Direct install the latest version can compatible with python 3.8

Is what works; the issue doesn’t deserve the [invalid] tag but that’s neither here nor there FWIW the above worked for me as well.

This comment has been minimized.

Copy link Quote reply

Читайте также:  Программы для проверки орфографии и правописания

impulse2k commented Dec 16, 2019

Seeing the same TypeError as everyone else after upgrading Python to 3.8 from 3.7.5. Fixed with latest dev version. Windows user, so had to modify it to:

To some, it may seem obvious to change the extension. I wouldn’t have thought of it a few months ago, though.

This comment has been minimized.

Copy link Quote reply

quresa commented Dec 17, 2019

Most helpful. Thanks.

This comment has been minimized.

Copy link Quote reply

falcaodf commented Dec 18, 2019

pip install https://github.com/pyinstaller/pyinstaller/archive/develop.tar.gz

Direct install the latest version can compatible with python 3.8

Thank you very much buddy

This comment has been minimized.

Copy link Quote reply

sharanraj63 commented Dec 26, 2019

I am able to make exe after following @shuax solution but facing the following issue while executing the exe:

Traceback (most recent call last):
File "AriesoProcess.py", line 7, in
from RPAWrapper import ClsRPAWrapper
File "c:usersearptkaappdatalocalprogramspythonpython38libsite-packagesPyInstallerloaderpyimod03_importers.py", line 621, in exec_module
exec(bytecode, module.dict)
File "RPAWrapper.py", line 7, in
from ConfigParser import ConfigParser
File "c:usersearptkaappdatalocalprogramspythonpython38libsite-packagesPyInstallerloaderpyimod03_importers.py", line 621, in exec_module
exec(bytecode, module.dict)
File "ConfigParser.py", line 1, in
import pandas as pd
File "c:usersearptkaappdatalocalprogramspythonpython38libsite-packagesPyInstallerloaderpyimod03_importers.py", line 621, in exec_module
exec(bytecode, module.dict)
File "site-packagespandas_init_.py", line 16, in
ImportError: Unable to import required dependencies:
numpy:

IMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE!

Importing the numpy c-extensions failed.

Try uninstalling and reinstalling numpy.

If you have already done that, then:

  1. Check that you expected to use Python3.8 from "C:UsersearptkaDesktopAriesoPy3AriesoPy3AriesoProcess.exe",
    and that you have no directories in your PATH or PYTHONPATH that can
    interfere with the Python and numpy version "1.18.0" you’re trying to use.
  2. If (1) looks fine, you can open a new issue at
    https://github.com/numpy/numpy/issues. Please include details on:
    • how you installed Python
    • how you installed numpy
    • your operating system
    • whether or not you have multiple versions of Python installed
    • if you built from source, your compiler versions and ideally a build log

    If you’re working with a numpy git repository, try git clean -xdf
    (removes all files not under version control) and rebuild numpy.

    Note: this error has many possible causes, so please don’t comment on
    an existing issue about this — open a new one instead.

    Original error was: DLL load failed while importing _multiarray_umath: The specified module could not be found.

    [23260] Failed to execute script AriesoProcess

    This comment has been minimized.

    Copy link Quote reply

    Kolaposki commented Dec 27, 2019

    pip install https://github.com/pyinstaller/pyinstaller/archive/develop.tar.gz

    Direct install the latest version can compatible with python 3.8

    Thanks very much. You are a live saver

    This comment has been minimized.

    Copy link Quote reply

    Governnment commented Dec 28, 2019

    pip install https://github.com/pyinstaller/pyinstaller/archive/develop.tar.gz

    Direct install the latest version can compatible with python 3.8

    This comment has been minimized.

    Copy link Quote reply

    seathson commented Dec 28, 2019

    pip install https://github.com/pyinstaller/pyinstaller/archive/develop.tar.gz

    Direct install the latest version can compatible with python 3.8
    Thank you

    This comment has been minimized.

    Copy link Quote reply

    loaiahmed commented Dec 28, 2019

    pip install https://github.com/pyinstaller/pyinstaller/archive/develop.tar.gz

    Direct install the latest version can compatible with python 3.8

    you are the best

    This comment has been minimized.

    Copy link Quote reply

    oelkanne commented Jan 2, 2020

    pip install https://github.com/pyinstaller/pyinstaller/archive/develop.tar.gz

    Direct install the latest version can compatible with python 3.8

    Thx. 4hrs searching has come to an end. praise him

    This comment has been minimized.

    Copy link Quote reply

    123-emir commented Jan 4, 2020

    This comment has been minimized.

    Copy link Quote reply

    rrifqimr commented Jan 8, 2020

    pip install https://github.com/pyinstaller/pyinstaller/archive/develop.tar.gz

    Direct install the latest version can compatible with python 3.8

    Love it, thanks bro !

    This comment has been minimized.

    Copy link Quote reply

    123-emir commented Jan 9, 2020

    i have it tried what shuax say,
    but its not working.

    I am using MacOs Catalina 10.15
    here is the log:

    Рекомендуем к прочтению

    Добавить комментарий

    Ваш адрес email не будет опубликован.