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

Error on running the Flask UI with Python 3 #127

Open
jaiongit opened this issue Mar 10, 2021 · 5 comments
Open

Error on running the Flask UI with Python 3 #127

jaiongit opened this issue Mar 10, 2021 · 5 comments
Assignees
Labels
gssoc21 help wanted Extra attention is needed up for grabs

Comments

@jaiongit
Copy link

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.

@welcome
Copy link

welcome bot commented Mar 10, 2021

Thanks for opening your first issue!
Mentors will get back to you soon.
Meanwhile check this repo for more.

Hacktoberfest2020

@jaiongit
Copy link
Author

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.

@Kashish121
Copy link
Collaborator

Kashish121 commented Mar 12, 2021

@jaiongit I came across this explanation while looking for error you mentioned.
Thanks for putting it up here. 💯

Solution:
Just delete all .pyc files located in the same directory as .py files.

Hope the issue is resolved.

@jaiongit
Copy link
Author

@Kashish121 So, should this issue be closed? Or we need to delete .pyc files automatically (if possible).
I think if that's not possible we should mention this in the README.

@Kashish121
Copy link
Collaborator

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
gssoc21 help wanted Extra attention is needed up for grabs
Projects
None yet
Development

No branches or pull requests

3 participants