ao9000 / tic-tac-toe-ai Goto Github PK
View Code? Open in Web Editor NEWTic Tac Toe with Minimax AI implementation in Python for educational purposes
Tic Tac Toe with Minimax AI implementation in Python for educational purposes
I have this erro after using: pyinstaller --onefile -w main.py
pyinstaller failed to execute script pyi_rth_pkgres
can anyone help me
Description
With the current version of Pyinstaller (3.6), there seems to be an error when trying to run the compiled executable.
Error Message
Traceback (most recent call last):
File "C:\ProgramData\Anaconda3\envs\tic-tac-toe-ai\Lib\site-packages\PyInstaller\loader\rthooks\pyi_rth_pkgres.py", line 13, in
import pkg_resources as res
File "c:\programdata\anaconda3\envs\tic-tac-toe-ai\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 623, in exec_module
exec(bytecode, module.dict)
File "site-packages\pkg_resources_init_.py", line 86, in
ModuleNotFoundError: No module named 'pkg_resources.py2_warn'
[1996] Failed to execute script pyi_rth_pkgres
Understanding the error
There seems to be some package incompatibility with Pyinstaller and setuptools, leading to Pyinstaller not being able to detect that setuptool is installed.
How to reproduce the error
Compiling the script run_game.py
will produce the error when attempting to launch the output executable.
# Compiling the game into an executable
pyinstaller run_game.py
# Running this command in cmd will show you the error without closing
run_game.exe
Solution
setuptools 46.0.0 is the culprit for the error, simply downgrade the version to 44.0.0 and re-compile it again will do the trick.
# Check setuptools version
easy_install --version
# Uninstall setuptools
pip uninstall setuptools
# Installing a lower version of setuptools
pip install setuptools==44.0.0
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.