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.

Error on running the Flask UI with Python 3

See original GitHub issue

While working with Python 3 (version 3.9.1 on my local machine) and checking out to feature/python3.8 branch the following error occurs when trying to run the Flask UI:

File "/path/to/PortScanner/src/mainScanner.py", line 10, in <module>
    from multi.scanner_thread import split_processing
ImportError: bad magic number in 'multi': b'\x03\xf3\r\n'

I am assuming this is caused due to using more recent Python 3 version than the one specified in README.md.

Mentioning @Kashish121 as stated by @vinitshahdeo.

Originally this issue was discussed here.

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
jaiongitcommented, Mar 12, 2021

I’ve discovered that this issue occurs when someone first tries to run the CLI through Python2. This results in creation of Python2 *.pyc files on the local machine. After this if the those files are not deleted and on running Flask UI through Python3 (which uses old Python2 *.pyc file), we get the above error. This issue will be fixed if those files are deleted before running the Flask UI through Python3.

0reactions
Kashish121commented, Mar 13, 2021

Raised an issue #150 , keeping this issue open for future references.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How To Handle Errors in a Flask Application - DigitalOcean
A local Python 3 programming environment. ... Then run the application server using the flask run command: flask run.
Read more >
i am getting a error when i am running the flask application ...
I aim to plot a line graph on the webpage using flask and charts.js I am just a beginner so I followed the...
Read more >
windows install - ModuleNotFound Error when running 'flask ...
I am using this guide to build a FreeTAKServer on a windows machine with Python3. When running this code: set FLASK_APP=run.py flask run...
Read more >
Handling Application Errors — Flask Documentation (2.2.x)
When Flask catches an exception while handling a request, it is first looked up by code. If no handler is registered for the...
Read more >
Flask by Example – Text Processing with Requests ...
02/22/2015: Added Python 3 support. Free Bonus: Click here to get access to a free Flask + Python video tutorial that shows you...
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