missing pydoc module

Post here if you are a new Porteus member and you're looking for some help.
nick613
White ninja
White ninja
Posts: 8
Joined: 28 Oct 2018, 02:39
Distribution: 4.0

missing pydoc module

Post#1 by nick613 » 30 Oct 2018, 19:19

I just installed PyCharm but the console and all debugging was not starting because it said it couldn't find the pydoc module. I checked in shell and it seems that it's missing from the Python installation. Is there any reason for this and is there any way to fix it?
Thanks!

User avatar
ncmprhnsbl
DEV Team
DEV Team
Posts: 4123
Joined: 20 Mar 2012, 03:42
Distribution: v5.0-64bit
Location: australia
Contact:

missing pydoc module

Post#2 by ncmprhnsbl » 30 Oct 2018, 22:32

yes, pydoc(among other stuff) is stripped from the default porteus, mainly because it's not needed for *most* apps to run..
however, it is needed for some packages to build, and python dev stuff..
probably it should make it's way into 05-devel.xzm, but afaics, it doesn't..
so, for the moment, what i'd do is grab the full python package and either grab what you need from it or make a module of the whole thing..
check to match the version with installed version maybe.
Forum Rules : https://forum.porteus.org/viewtopic.php?f=35&t=44

nick613
White ninja
White ninja
Posts: 8
Joined: 28 Oct 2018, 02:39
Distribution: 4.0

missing pydoc module

Post#3 by nick613 » 31 Oct 2018, 00:15

Is it possible to just install a fresh copy of python over the old one?

User avatar
ncmprhnsbl
DEV Team
DEV Team
Posts: 4123
Joined: 20 Mar 2012, 03:42
Distribution: v5.0-64bit
Location: australia
Contact:

missing pydoc module

Post#4 by ncmprhnsbl » 31 Oct 2018, 00:29

you mean in the live system, saved to changes or in the extracted 001-core? (or as a module loaded on top)
i'd say yes to any of these.. shouldn't break anything.
Forum Rules : https://forum.porteus.org/viewtopic.php?f=35&t=44

nick613
White ninja
White ninja
Posts: 8
Joined: 28 Oct 2018, 02:39
Distribution: 4.0

missing pydoc module

Post#5 by nick613 » 31 Oct 2018, 02:32

Cool. So what would be the simplest option to prevent any future problems? I'd like to use the OS primarily for python development and so I'd like to have all the default modules work without any hitches.

User avatar
ncmprhnsbl
DEV Team
DEV Team
Posts: 4123
Joined: 20 Mar 2012, 03:42
Distribution: v5.0-64bit
Location: australia
Contact:

missing pydoc module

Post#6 by ncmprhnsbl » 31 Oct 2018, 06:10

well, the simplist(and safest) would be to make a python module and put it in /modules. that way if there's a problem it's easy to roll back.
if all goes well you could then rebuild 001-core with the full package.
by: (# denotes root terminal)

Code: Select all

#cp /mnt/sd*/porteus/base/001-core.xzm /tmp (or any ext* partition)
#cd /tmp (or whereever)
#mkdir extract
#xzm2dir 001-core.xzm extract
then either
#xzm2dir python-module.xzm extract
or
#removepkg -r extract python2 (might not be necessary if version are same)
#installpkg -r extract python2*  (*wildcard saves typing the whole  pkg name)
then
#dir2xzm extract 001-core-m.xzm (m for modified)
replace in base
for reference, here's what is removed:

Code: Select all

	rm -rf usr/lib${SUFFIX}/python2.7/distutils/tests/*
	rm -rf usr/lib${SUFFIX}/python2.7/unittest/test/*
	rm -rf usr/lib${SUFFIX}/python2.7/test/*
	rm -rf usr/lib${SUFFIX}/python2.7/ctypes/test/*
	rm -rf usr/lib${SUFFIX}/python2.7/json/tests/*
	rm -rf usr/lib${SUFFIX}/python2.7/bsddb/test/*
	rm -rf usr/lib${SUFFIX}/python2.7/email/test/*
	rm -rf usr/lib${SUFFIX}/python2.7/lib-tk/test/*
	rm -rf usr/lib${SUFFIX}/python2.7/sqlite3/test/*
	rm -rf usr/lib${SUFFIX}/python2.7/lib2to3/tests/*
	rm -rf usr/lib${SUFFIX}/python2.7/idlelib/*
	rm -rf usr/lib${SUFFIX}/python2.7/lib-tk/*
	rm -rf usr/lib${SUFFIX}/python2.7/lib2to3/*
	rm usr/lib${SUFFIX}/python2.7/pydoc.py* 2>/dev/null
	rm usr/lib${SUFFIX}/python2.7/tabnanny.py* 2>/dev/null
Forum Rules : https://forum.porteus.org/viewtopic.php?f=35&t=44

nick613
White ninja
White ninja
Posts: 8
Joined: 28 Oct 2018, 02:39
Distribution: 4.0

missing pydoc module

Post#7 by nick613 » 01 Nov 2018, 18:36

I'm sorry, but you may have to hold my hand here. How would I make a python module? I downloaded the tar.xz from the python website, but how would I make that into a module? I tried to extract it and build it with dir2xzm but that didn't seem to do the trick.

User avatar
ncmprhnsbl
DEV Team
DEV Team
Posts: 4123
Joined: 20 Mar 2012, 03:42
Distribution: v5.0-64bit
Location: australia
Contact:

missing pydoc module

Post#8 by ncmprhnsbl » 01 Nov 2018, 22:31

i didn't think to ask: python 2 or 3? i'm guessing probably 3 since 2 is in line to be deprecated.
anyway here's links for slackware packages:
python2:
http://ftp.slackware.com/pub/slackware/ ... 6_64-3.txz
python3:
http://ftp.slackware.com/pub/slackware/ ... 6_64-1.txz
in your filemanager rightclick menu you should find "convert txz to xzm" or "convert slackware to module" or something like that.
the tar.xz from the python website is the source files and would need to be compiled, which is a whole other ball game.
btw, which desktop are you using?
Forum Rules : https://forum.porteus.org/viewtopic.php?f=35&t=44

nick613
White ninja
White ninja
Posts: 8
Joined: 28 Oct 2018, 02:39
Distribution: 4.0

missing pydoc module

Post#9 by nick613 » 02 Nov 2018, 04:35

Yeah, I'm looking to set up python 3 but I'd probably get 2 as well in case I need it later.
I'm using Cinnamon for my desktop.
So I downloaded and converted into a module. It's inserting into the OS properly because it's taking over my python3 command, but I'm getting an error:
python3: /lib64/libc.so.6: version `GLIBC_2.28' not found (required by /usr/lib64/libpython3.6m.so.1.0)
The machine is running 2.27. How can this be updated?

User avatar
ncmprhnsbl
DEV Team
DEV Team
Posts: 4123
Joined: 20 Mar 2012, 03:42
Distribution: v5.0-64bit
Location: australia
Contact:

missing pydoc module

Post#10 by ncmprhnsbl » 02 Nov 2018, 05:06

hmm, i feared that something like that might be the case, since we're using slackware current which is rolling, and since the april release, they've moved on with a few things. glibc being one of them..
it might be enough to make an updated glibc http://ftp.slackware.com/pub/slackware/ ... 6_64-2.txz
but, this might mess up other stuff(i don't fully understand this)
we are currently working on getting a new updated release together, hopefully soon..
at some point when slackware 15 is released, and repo becomes semi-fixed again, this sort of problem won't occur..
Forum Rules : https://forum.porteus.org/viewtopic.php?f=35&t=44

jssouza
Legendary
Legendary
Posts: 1165
Joined: 09 Jul 2015, 14:17
Distribution: Porteus x86 arm

missing pydoc module

Post#11 by jssouza » 02 Nov 2018, 05:27

Maybe try the other way round.
Here are the python packages from Slackware current at the time when Cinnamon was built for Porteus 4. These might work for your use case.

python-2.7.14-x86_64-1.txz
python3-3.6.5-x86_64-2.txz

nick613
White ninja
White ninja
Posts: 8
Joined: 28 Oct 2018, 02:39
Distribution: 4.0

missing pydoc module

Post#12 by nick613 » 02 Nov 2018, 18:23

Thanks for the help. I tried what jssouza suggested and the module loads nicely, and now pydoc3 seems to be functioning properly, as well as PyCharm. Thanks for all your help.

User avatar
ncmprhnsbl
DEV Team
DEV Team
Posts: 4123
Joined: 20 Mar 2012, 03:42
Distribution: v5.0-64bit
Location: australia
Contact:

missing pydoc module

Post#13 by ncmprhnsbl » 02 Nov 2018, 23:38

:good:
and thank you jssouza, too!
Forum Rules : https://forum.porteus.org/viewtopic.php?f=35&t=44

vinnie
Samurai
Samurai
Posts: 132
Joined: 13 Jun 2024, 08:25
Distribution: alpine

missing pydoc module

Post#14 by vinnie » 16 Jun 2024, 05:18

ncmprhnsbl wrote:
31 Oct 2018, 06:10

Code: Select all

#cp /mnt/sd*/porteus/base/001-core.xzm /tmp (or any ext* partition)
#cd /tmp (or whereever)
#mkdir extract
#xzm2dir 001-core.xzm extract
then either
#xzm2dir python-module.xzm extract
or
#removepkg -r extract python2 (might not be necessary if version are same)
#installpkg -r extract python2*  (*wildcard saves typing the whole  pkg name)
then
#dir2xzm extract 001-core-m.xzm (m for modified)
replace in base
Sorry for necroposting but I have just this problem, I am exploring porteus a bit and after installing pip separately (with getpkg python-pip as mentioned in another topic), I find myself without the help() command in python, I miss pydoc :)
I understand it's in devel however it's 140mb, I would prefer to uncorporate just that library, the problem is that xzm2dir doesn't seem to work.
I try to run the command but it keeps returning me the help:

Code: Select all

guest@porteus:/mnt/sdb4/devel$ mkdir ./extract
guest@porteus:/mnt/sdb4/devel$ xzm2dir ./05-devel.xzm ./extract

Extract .xzm module to folder
Usage: xzm2dir moduleName.xzm [outputFolder]
Example: xzm2dir module.xzm
Example: xzm2dir module.xzm outputFolder

User avatar
ncmprhnsbl
DEV Team
DEV Team
Posts: 4123
Joined: 20 Mar 2012, 03:42
Distribution: v5.0-64bit
Location: australia
Contact:

missing pydoc module

Post#15 by ncmprhnsbl » 16 Jun 2024, 23:06

vinnie wrote:
16 Jun 2024, 05:18
the problem is that xzm2dir doesn't seem to work
:o seems a bug has been introduced by me presumably.. a rubbish test in the script: /opt/porteus-scripts/xzm2dir :
this line:

Code: Select all

if [ "$1" == "" ] || [ "$1" == "-h" ] || [ "$1" != "*.xzm" ]; then
in particular:

Code: Select all

 [ "$1" != "*.xzm" ]
a glob in a test like that apparently doesn't work so either remove that bit or change it to something like:

Code: Select all

[ $(echo "$1" | grep "*.xzm") ]
edit: or less idiotic q:

Code: Select all

[ "${1##*.}" != "xzm" ]
could go as far as using something more complicated involving file to check it's a squashfs, but that seems a bit unnecessary...

else, for the moment use the rightclick menu in the (root)filemanager "extract module" option or even just "mount module" and copy what you want from /mnt/loop and unmount it after.
Forum Rules : https://forum.porteus.org/viewtopic.php?f=35&t=44

Post Reply