Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

Psycopg2 in pydroid3 #1570

Closed
doublyU opened this issue May 7, 2023 · 6 comments
Closed

Psycopg2 in pydroid3 #1570

doublyU opened this issue May 7, 2023 · 6 comments

Comments

@doublyU
Copy link

doublyU commented May 7, 2023

I want use psycopg2 in pydroid3, I already installed psycopg2 using termux and copy it working directory of my pydroid3 and is giving me this error below.

Traceback (most recent call last):
File "/data/user/0/ru.iiec.pydroid3/files/accomp_files/iiec_run/iiec_run.py", line 31, in
start(fakepyfile,mainpyfile)
File "/data/user/0/ru.iiec.pydroid3/files/accomp_files/iiec_run/iiec_run.py", line 30, in start
exec(open(mainpyfile).read(), main.dict)
File "", line 6, in
File "/storage/emulated/0/python_folder/psycopg2/init.py", line 51, in
from psycopg2._psycopg import ( # noqa
ModuleNotFoundError: No module named 'psycopg2._psycopg'

[Program finished]

Psycopg2 is not installed by using pydroid3 terminal that is I used termux to install it and copy it the working directory of my pydroid3

@rohan472000
Copy link

rohan472000 commented May 7, 2023

It seems like the installation of psycopg2 in Termux may not be compatible with the Python environment in Pydroid3.

Instead of manually copying the installed psycopg2 package from Termux to Pydroid3, I would suggest installing it directly in Pydroid3 using the pip package manager. Here are the steps to install psycopg2 in Pydroid3:

  1. Open Pydroid3 and open the Terminal from the top menu.

  2. In the Terminal, run the following command to install pip if it is not already installed:
    python -m ensurepip --default-pip

  3. Once pip is installed, run the following command to install psycopg2:
    pip install psycopg2

This should download and install the psycopg2 package and its dependencies in your Pydroid3 environment.

After installing psycopg2 with pip, you should be able to import it in your Python code without any issues.

@doublyU
Copy link
Author

doublyU commented May 7, 2023 via email

@doublyU
Copy link
Author

doublyU commented May 7, 2023

It seems like the installation of psycopg2 in Termux may not be compatible with the Python environment in Pydroid3.

Instead of manually copying the installed psycopg2 package from Termux to Pydroid3, I would suggest installing it directly in Pydroid3 using the pip package manager. Here are the steps to install psycopg2 in Pydroid3:

  1. Open Pydroid3 and open the Terminal from the top menu.
  2. In the Terminal, run the following command to install pip if it is not already installed:
    python -m ensurepip --default-pip
  3. Once pip is installed, run the following command to install psycopg2:
    pip install psycopg2

This should download and install the psycopg2 package and its dependencies in your Pydroid3 environment.

After installing psycopg2 with pip, you should be able to import it in your Python code without any issues.

I had done that before dropped message to GitHub but it didn't work I attached error message that I am getting from terminal to this email. I really appreciate for respond to me.
I am still looking forward to get reply back from you.

@doublyU doublyU closed this as completed May 7, 2023
@doublyU doublyU reopened this May 7, 2023
@doublyU
Copy link
Author

doublyU commented May 7, 2023

It seems like the installation of psycopg2 in Termux may not be compatible with the Python environment in Pydroid3.
Instead of manually copying the installed psycopg2 package from Termux to Pydroid3, I would suggest installing it directly in Pydroid3 using the pip package manager. Here are the steps to install psycopg2 in Pydroid3:

  1. Open Pydroid3 and open the Terminal from the top menu.
  2. In the Terminal, run the following command to install pip if it is not already installed:
    python -m ensurepip --default-pip
  3. Once pip is installed, run the following command to install psycopg2:
    pip install psycopg2

This should download and install the psycopg2 package and its dependencies in your Pydroid3 environment.
After installing psycopg2 with pip, you should be able to import it in your Python code without any issues.

I had done that before dropped message to GitHub but it didn't work I attached error message that I am getting from terminal to this email. I really appreciate for respond to me. I am still looking forward to get reply back from you.

Uploading Screenshot_2023-05-07-15-40-35-000_ru.iiec.pydroid3.jpg…

@rohan472000
Copy link

Try this - pip install psycopg2-binary

@dvarrazzo
Copy link
Member

I understand that Pydroid3 is a framework for Android. What platform would that be?

Most likely, psycopg2-binary will not work, and installing the library from source requires depending libraries compiled for the same platform (libpq, libssl in order to support encryption), or building them from source.

@psycopg psycopg locked and limited conversation to collaborators May 7, 2023
@dvarrazzo dvarrazzo converted this issue into discussion #1572 May 7, 2023

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants