termux / termux-app

Termux - a terminal emulator application for Android OS extendible by variety of packages.
https://f-droid.org/en/packages/com.termux
Other
36.99k stars 3.89k forks source link

[Bug]: python virtualenv #4089

Closed user-11150 closed 3 months ago

user-11150 commented 3 months ago

Problem description

python virtualenv cannot create in external storage

Steps to reproduce the behavior.

Use virtualenv:

PermissionError: [Errno 1] Operation not permitted: '/data/data/com.termux/files/usr/bin/python3.11' -> '/storage/emulated/0/My_file/projects/puel/env/bin/python'

Use venv:

Error: [Errno 1] Operation not permitted: 'lib' -> '/storage/emulated/0/My_file/projects/puel/venv/lib64'

What is the expected behavior?

Successful to create virtualenv

System information

twaik commented 3 months ago

Do not try to put virtualenv or any executable code to sdcard. Sdcardfs has restrictions and does not allow executables or symlinks.

user-11150 commented 3 months ago

Use conda?

twaik commented 3 months ago

It does not matter what you use to create virtualenv. Do not use sdcard or shared storage for this.

user-11150 commented 3 months ago

Why I can run c extensions(like viztracer) in external storage

twaik commented 3 months ago

Scripts can be used. But not executables. I mean if you do something like python3 ./somescript.py it will run fine, but ./somescript.py will not work. And many python stuff uses the latter option.

user-11150 commented 3 months ago

Is /bin/xxx not external storage?

Why I can run like /bin/ls

twaik commented 3 months ago

/bin is a part of core OS.

user-11150 commented 3 months ago

Is external storage just /storage/emulated/0/ and SD cards?

twaik commented 3 months ago

You should not use anything under /storage and /mnt.

user-11150 commented 3 months ago

Do you have VM can run tsu?

twaik commented 3 months ago

Termux does not run in VMs properly. They do not have proper implementations for some subsystems required by Termux.

user-11150 commented 3 months ago

Is kali not a VM?

sylirre commented 3 months ago

/storage/emulated/0, external SD cards and whatever else except private internal storage (/data/data/com.termux) doesn't support execution and special files such as symbolic links.

Read https://wiki.termux.com/wiki/Internal_and_external_storage

Please setup your stuff in Termux home directory. Many code editors can access it without root permissions. QuickEdit app is an example of such editors.


Do not report issues about stuff beyond the control of Termux, like behavior of Android OS and file system limited features.

sylirre commented 3 months ago

Is kali not a VM?

No, it is not a VM but is a distribution that is not related to Termux in any way.