Skip to content
This repository has been archived by the owner on Feb 28, 2023. It is now read-only.

pysqlite is not supported on Python 3 #171

Open
jielab opened this issue Aug 4, 2021 · 23 comments
Open

pysqlite is not supported on Python 3 #171

jielab opened this issue Aug 4, 2021 · 23 comments

Comments

@jielab
Copy link

jielab commented Aug 4, 2021

Hi, there:

I thought that postGAP is a pretty cool idea.

However, I tried many times but still could not successfully install it.

Please see the message below.

11

Can you please instruct me how to install? I simply want to try it out.

Best regards,
jie

@dzerbino
Copy link
Contributor

dzerbino commented Aug 6, 2021

Dear @jielab

This boils down to a Python version issue: PostGAP is still on Python2, while I am guessing your copy of pip points to pip3.

I'm afraid that for the moment we are staying on Python2.

Hope this helps,

Daniel

@jielab
Copy link
Author

jielab commented Aug 7, 2021

Dear Daniel:

Thanks. I now installed Pyton2 and set it as the defalt. I now got it successfully installed.

Please see the screenshot below. Somehow it still reports error.

11

Best regadrs,
Jie

@dzerbino
Copy link
Contributor

dzerbino commented Aug 7, 2021

Hello @jielab ,

This is because you need to set your Python path environment variable, as explained in the Manual.

In your case, assuming you are using Bash, it would look like:

export PYTHONPATH=$PYTHONPATH:/mnt/d/software_lin/postgap/lib

Hope this helps,

Daniel

@jielab
Copy link
Author

jielab commented Aug 7, 2021

Thanks, Daniel!

I did add that to both PYTHONPATH and PATH.
I created an alias of "python" for "python2". However, when I type "which python", it still points to python3.
I don't know if that is the cause of error. If so, how to set it correctly?

11

Thank!

Jie

@dzerbino
Copy link
Contributor

dzerbino commented Aug 8, 2021

Hello Jie,

You can circumvent the python alias mapping entirely by calling python2 directly:

python2 POSTGAP.py etc etc

Cheers,

Daniel

@jielab
Copy link
Author

jielab commented Aug 8, 2021

Dear Daniel:

Thank you very much! But it still does not work.

11

Best regards,
Jie

@dzerbino
Copy link
Contributor

dzerbino commented Aug 8, 2021

Dear Jie,

This is very odd because normally Python paths are case-sensitive. Are you working on a Windows machine?

The solution would be to rename your POSTGAP script, e.g.:

mv POSTGAP.py POSTGAP-script.py

Then call that one:

python2 POSTGAP-script.py etc etc

Hope this helps,

Daniel

@jielab
Copy link
Author

jielab commented Aug 8, 2021

Dear Daniel:

Yes, I am running on the Ubuntu Linux coming with Windows 11. I changed the name of the script. But still it does not work.

11

Best regards,
Jie

@dzerbino
Copy link
Contributor

dzerbino commented Aug 9, 2021

This is starting to get very odd, what do you get when you do:

ls -l /mnt/d/software_lin/postgap/postgap.py
ls -l /mnt/d/software_lin/postgap1/

Daniel

@jielab
Copy link
Author

jielab commented Aug 9, 2021

Dear Daniel:

Here it is. It seems that Windows Ubuntu Linux is case insensitive.

11

Best regards,
Jie

@dzerbino
Copy link
Contributor

dzerbino commented Aug 9, 2021

Hello Jie,

I'm confused, in your previous message, I saw:

...
/mnt/d/software_lin# mv postgap/ postgap1
...

How come when you are doing ls now, there still appears /mnt/software_lin/postgap/ ?

Daniel

@jielab
Copy link
Author

jielab commented Aug 9, 2021

Sorry for the confusion. I moved postgap1 back to postgap, since renaming the folder to postgap1 does not solve the error.

I now renamed to postgap1 again, and typed the two commands that you showed:

11

Best regards,
jie

@dzerbino
Copy link
Contributor

dzerbino commented Aug 9, 2021

I think I found it, could you please delete /mnt/software_lin/postgap1/postgap.pyc and try again?

@jielab
Copy link
Author

jielab commented Aug 9, 2021

Dear Daniel;

It still does not work...

11

@jielab
Copy link
Author

jielab commented Aug 9, 2021

I just removed python.pyc and run it again. Please see below. This time, the error message is different.

My student said that this might have to do with the possibility that postgap is installed in some environment, while currently I am in the "(base)" mode. As shown in the following screenshot.

11

Best regards,
Jie

@dzerbino
Copy link
Contributor

Dear Jie,

I don't understand you set up, so it is hard to guess at the source of the problem, but I do notice a few things:

  • Two messages up you remove postgap.pyc but proceed to run python2 POSTGAP.py, thus re-creating postgap.pyc
  • In the message just above, it is unclear whether $PYTHONPATH was set or not. Running export only sets environment variables for the current session.

In short, I would recommend that in a clean session you:

  1. Remove postgap.py
  2. Set $PYTHONPATH
  3. Run python2 POSTGAP-script.py etc etc

Hope this helps,

Daniel

@jielab
Copy link
Author

jielab commented Aug 10, 2021

Dear Daniel:

Thank you for your time and your help.

Previously, after i renamed postgap to postgap1, i did not update the PYTHONPATH accordingly in the .bashrc file. I now did so.
Please see screenshot below. Now there is a new error message.

11

Best regards,
Jie

@dzerbino
Copy link
Contributor

Dear Jie,

Progress!

The absence of modules such as requests suggests you simply need to install them, e.g. with pip or conda:

pip install --user pybedtools==0.7.4 requests pandas flask cherrypy h5py==2.8.0 pysqlite

Hope this helps,

Daniel

@jielab
Copy link
Author

jielab commented Aug 11, 2021

Dear Daniel:

I wish there is an easy way to make this work. Maybe the following error still has something to do with python2 vs. python3...

11

Best regards,
jie

@dzerbino
Copy link
Contributor

Dear Jie,

The problem is that you have Python2 and Python3 interfering with each other.

There are number of ways to make this work:

  • the clean way would be to use Python environments to ensure Python2 and Python3 do not interfere with each other
  • a more onerous way would be to install the VirtualBox VM
  • I recently added a Dockerfile, which is not yet documented, but would allow you to create a standalone Ubuntu environment with all the requirements.

Hope this helps,

Daniel

@jielab
Copy link
Author

jielab commented Aug 13, 2021

Dear Daniel:

Thank you very much. Just curious, will you plan to release the Python3 version in the future?

Best regards,
Jie

@dzerbino
Copy link
Contributor

Dear Jie,

Now that you mention it, I was holding out on doing the Python3 upgrade waiting for updates from a collaborator, but alas they are delayed, so I may as well do the upgrade soon-ish.

Hopefully I can do it in the next few weeks.

Regards,

Daniel

@jielab
Copy link
Author

jielab commented Aug 13, 2021

Dear Daniel:

That's great to hear! I look forward to the new version based on python3.

Windows 11, iPhone 12, we realize that our life is moving foward by seeing new versions of software :- )

Best regards,
Jie

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

No branches or pull requests

2 participants