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

Python 3 support #19

Open
bgruening opened this issue Jan 31, 2021 · 10 comments
Open

Python 3 support #19

bgruening opened this issue Jan 31, 2021 · 10 comments

Comments

@bgruening
Copy link

It would be nice to run MitoFinder under Python 3. This will enable to mix this nice pipeline with others in one environment.

@junaruga
Copy link

The pipeline is mainly written in python 2.7.

It would be nice to have Python 3 support. Python 2 is not supported by the Python project anymore.

https://www.python.org/doc/sunset-python-2/

Sunsetting Python 2

We are volunteers who make and take care of the Python programming language. We have decided that January 1, 2020, was the day that we sunset Python 2. That means that we will not improve it anymore after that day, even if someone finds a security problem in it. You should upgrade to Python 3 as soon as you can.

https://developers.redhat.com/blog/2019/10/25/python-2-support-is-going-away-soon-make-the-move-to-python-3

@jacquefm
Copy link

jacquefm commented Mar 3, 2023

I have a fork that is compatible with python3 if you want to try it: https://github.com/jacquefm/MitoFinder-python3. It works on my setup but it would be nice to see if this works well for others.

@JGLAHE
Copy link

JGLAHE commented Apr 27, 2023

@jacquefm thanks for that! How can I provide feedback to you? Can you activate issues on that fork?

@jacquefm
Copy link

@JGLAHE Sure thing. Issues activated.

@Adamtaranto
Copy link

I've also made a fork of this project that is ported to Python 3 and refactored to work as a pip installable package and has improved error logging.

Basic use cases are working. If anyone finds a bug please open an issue.

https://github.com/Adamtaranto/MitoFinder

@OndroV
Copy link

OndroV commented Feb 5, 2024

Not sure if the only problem is the spaces instead of brackets after print command, but I had to try and solve the problem myself again because the README in your forks @Adamtaranto and @jacquefm still refers to this RemiAllio version... so my colleague and I haven't noticed and installed the old one thinking that it's your Python3 version :D

For anyone going through the struggle, here is a part of code that we devised to do most of the replacing:
for f in $(ls *.py); do lines=$(grep -n "print " $f | cut -d: -f1) ; sed -i "s/print /print(/" $f ; for l in $lines; do sed -i "${l}s/$/)/" $f ; done ; done
Then we run python3 ./mitofinder -h and had to manually fix a few lines where the closing bracket should not have been added at the end... this way we were able to obtain the help message as desired.

If it's not the only adaptation from python2 to python3 then I guess we will land on your versions... thanks :)

@Adamtaranto
Copy link

@OndroV I changed quite a lot of things.
To install do: pip install git+https://github.com/Adamtaranto/MitoFinder.git.

Install any other dependencies via Conda. The software will check for them on your path.

@OndroV
Copy link

OndroV commented Feb 6, 2024

Thanks for your reply @Adamtaranto , but we got the same outcomes, i.e. the package was regarded as UNKNOWN and mitofinder was giving errors (no such file or directory...).

We tried switching from WSL to Anaconda PowerShell Prompt and got a more desirable installation:
"Successfully installed mitofinder-0.1.dev203+gbb3ca13"
But no success at installing dependencies with conda install -c Adamtaranto mitofinder , nor at attempting to run mitofinder, mitofinder.exe, python mitofinder -h etc.

So we switched to @jacquefm 's version, which we could easily install and use as described in the README. We only had to edit two installation commands: wget https://github.com/jacquefm/MitoFinder-python3/archive/master.zip and mv MitoFinder-python3-master MitoFinder

@JGLAHE
Copy link

JGLAHE commented Feb 6, 2024

Out curiosity @OndroV: which version of WSL (and with which distro) were you using?

@OndroV
Copy link

OndroV commented Feb 6, 2024

Ubuntu 22.04.3 on WSL 2, Windows 10

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants