Thinstation / thinstation

A framework for making thin and light Linux based images for x86 based machines and thinclients.
https://www.thinstation.net/
793 stars 187 forks source link

python PIP install #683

Closed rohrbachger closed 2 years ago

rohrbachger commented 2 years ago

In the actual TS I have the problem to install python stuff like in the versions before. In the chroot pip install pyodbc

Requirement already satisfied: pyodbc in /usr/lib/python3.9/site-packages (4.0.32) WARNING: Running pip as root will break packages and permissions. You should install packages reliably by using venv: https://pip.pypa.io/warnings/venv

python 3.8 and python 3.9 are in the lib folder.

Probably how I´m doing is wrong, but it has worked in older versions..

How I have to implement tools like pyodbc or pywinrm?

Doncuppjr commented 2 years ago

It’s just a warning not a failure.

Sent from Yahoo Mail for iPhone

On Thursday, November 25, 2021, 7:05 AM, rohrbachger @.***> wrote:

In the actual TS I have the problem to install python stuff like in the versions before. In the chroot pip install pyodbc

Requirement already satisfied: pyodbc in /usr/lib/python3.9/site-packages (4.0.32) WARNING: Running pip as root will break packages and permissions. You should install packages reliably by using venv: https://pip.pypa.io/warnings/venv

python 3.8 and python 3.9 are in the lib folder.

Probably how I´m doing is wrong, but it has worked in older versions..

How I have to implement tools like pyodbc or pywinrm?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android.

rohrbachger commented 2 years ago

But the ODBC connection is not working anymore, the module is missing or not correctly installed. So I will try at the weekend to get this fixed. With pywinrm I have also issues. Both probably have the same reason.

Thinstation commented 2 years ago

Do you need those in the chroot, or the final image? If it’s the final image, you can create a pip2.freeze or pip3.freeze in a package/build folder.

On Thu, Nov 25, 2021 at 11:34 AM rohrbachger @.***> wrote:

But the ODBC connection is not working anymore, the module is missing or not correctly installed. So I will try at the weekend to get this fixed. With pywinrm I have also issues. Both probably have the same reason.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/Thinstation/thinstation/issues/683#issuecomment-979416735, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAVW47QHYTMHY2DTJUCVLWDUNZ6S5ANCNFSM5IYT4XXQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

rohrbachger commented 2 years ago

I need it in the final image, it was always ugly... I copied the /lib python folders, as I was not able to figure out which files really were needed. So a lot of spaces needed, I guess it is near to 100MB. Is there any special way to do this? I did not found a similar package

Thinstation commented 2 years ago

Look at my octoprint package for an example of how to do python

On Fri, Nov 26, 2021 at 10:51 AM rohrbachger @.***> wrote:

I need it in the final image, it was always ugly... I copied the /lib python folders, as I was not able to figure out which files really were needed. So a lot of spaces needed, I guess it is near to 100MB. Is there any special way to do this? I did not found a similar package

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/Thinstation/thinstation/issues/683#issuecomment-980223342, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAVW47RA4NCMRBPBV5OD4J3UN7CLDANCNFSM5IYT4XXQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

rohrbachger commented 2 years ago

I looked at octoprint, but did not got it. Complex.

For my special needs I do need. unixodbc and freetds. I think it is similar to other ports. get the source and ./configure, make make install. ( currently I copy the lib files by script, dirty, but works a long time already. But I think I can create now a package for this, maybe someone else can use this. This has a learning effect.

For python I'm doing pip install pyodbc pip install pywinrm pip install pywinrm[credssp]

I copy /usr/lib/python3.9/distutils and site-packages folder. This makes my iso large, but I did not figured the needed files out.

Thinstation commented 2 years ago

Look at pip2.freeze in octoprint

On Sat, Nov 27, 2021 at 12:06 PM rohrbachger @.***> wrote:

I looked at octoprint, but did not got it. Complex.

For my special needs I do need. unixodbc and freetds. I think it is similar to other ports. get the source and ./configure, make make install. ( currently I copy the lib files by script, dirty, but works a long time already. But I think I can create now a package for this, maybe someone else can use this. This has a learning effect.

For python I'm doing pip install pyodbc pip install pywinrm pip install pywinrm[credssp]

I copy /usr/lib/python3.9/distutils and site-packages folder. This makes my iso large, but I did not figured the needed files out.

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/Thinstation/thinstation/issues/683#issuecomment-980786283, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAVW47RXC35QPESXUZIMGP3UOET2HANCNFSM5IYT4XXQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

rohrbachger commented 2 years ago

I have to spend time for testing, in general I understood. But some details I have to figure out.

rohrbachger commented 2 years ago

In general I got it working , the octoprint sample was a good help. I have created pyodbc, pywinrm, requests-credssp. In the Pgkfile I use source=( http://DESVR-PXE/jobs/requests-credssp-$version.tar.gz )

A web source to this py package seems not to work ( only python modules) , so I placed the file on our own server. This is a little bit dirty, But source=( file://DESVR-PXE/jobs/requests-credssp-$version.tar.gz ) seems not to work. I did not found a hint in build for this. Is there another script doint the ts/ports/nocache PgKfile? I would like to have the same logic like in the build.url

Thinstation commented 2 years ago

You don't need to make python ports unless you need python in the chroot. If you only need python packages in a build, use a pip2.freeze or pip3.freeze. Octoprint has both a port and a package. I wanted you to look at the package, and specifically at the pip2.freeze https://github.com/Thinstation/thinstation/blob/6.2-Stable/ts/build/packages/octoprint/build/pip2.freeze

rohrbachger commented 2 years ago

Got it, now I know how to build a port also... For the pyodbc and pywinrm port is not necessary, I know now.

with packages like unixodbc and freetds I still have ports, probably I do not need post also. I will test it also, I do need it only in the ts final image not in chroot.