Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.debian.user > #176431 > unrolled thread
| Started by | Joe Pfeiffer <pfeiffer@cs.nmsu.edu> |
|---|---|
| First post | 2017-01-08 04:50 +0100 |
| Last post | 2017-01-08 23:50 +0100 |
| Articles | 6 — 5 participants |
Back to article view | Back to linux.debian.user
python time module Joe Pfeiffer <pfeiffer@cs.nmsu.edu> - 2017-01-08 04:50 +0100
Re: python time module Michael Lange <klappnase@freenet.de> - 2017-01-08 12:40 +0100
Re: python time module lists@rickv.com - 2017-01-08 19:40 +0100
Re: python time module Rick Valenzuela <rick@rickv.com> - 2017-01-08 20:40 +0100
Re: python time module Nicolas George <george@nsup.org> - 2017-01-08 21:50 +0100
Re: python time module lists@rickv.com - 2017-01-08 23:50 +0100
| From | Joe Pfeiffer <pfeiffer@cs.nmsu.edu> |
|---|---|
| Date | 2017-01-08 04:50 +0100 |
| Subject | python time module |
| Message-ID | <sXcEx-YU-1@gated-at.bofh.it> |
I'm starting to try to learn pythonOCC (a wrapper on the OpenCascade 3d
modeling library) as an excuse to learn python itself, and am running
into some problems right off the bat.
(1) pythonOCC wants to be installed using a package manager called
conda (see http://www.pythonocc.org/download/ and
https://www.continuum.io/). Is there a reasonably standard way to
integrate conda with apt (in the same sense that alien will let me
install an RPM), or do I just sort of have to expect to use a
different system for it? Yes, I can download from source instead,
and may end up taking that approach, but would rather not if I can
avoid it.
(2) More seriously, I'm getting the following error and traceback trying
to run my very first script:
nowball:13$ python box1.py
Traceback (most recent call last):
File "box1.py", line 1, in <module>
from OCC.Display.SimpleGui import init_display
File "/home/joseph/python/lib/python2.7/site-packages/OCC/Display/SimpleGui.py", line 20, in <module>
import logging
File "/usr/lib/python2.7/logging/__init__.py", line 26, in <module>
import sys, os, time, cStringIO, traceback, warnings, weakref, collections
ImportError: No module named time
>From everything I'm finding, it looks like both the logging and time
modules should be installed by default with python; what do I need to
install that is missing at present to get the time module?
[toc] | [next] | [standalone]
| From | Michael Lange <klappnase@freenet.de> |
|---|---|
| Date | 2017-01-08 12:40 +0100 |
| Message-ID | <sXjZn-5Lf-11@gated-at.bofh.it> |
| In reply to | #176431 |
Hi, On Sat, 07 Jan 2017 20:29:05 -0700 Joe Pfeiffer <pfeiffer@cs.nmsu.edu> wrote: (...) > (2) More seriously, I'm getting the following error and traceback trying > to run my very first script: > > nowball:13$ python box1.py > Traceback (most recent call last): > File "box1.py", line 1, in <module> > from OCC.Display.SimpleGui import init_display > File > "/home/joseph/python/lib/python2.7/site-packages/OCC/Display/SimpleGui.py", > line 20, in <module> import logging File > "/usr/lib/python2.7/logging/__init__.py", line 26, in <module> import > sys, os, time, cStringIO, traceback, warnings, weakref, collections > ImportError: No module named time > > >From everything I'm finding, it looks like both the logging and time > modules should be installed by default with python; what do I need to > install that is missing at present to get the time module? not sure what happens there, are you building your own version of Python within /home/joseph ? Then maybe this failed to build the time module. Normally when you use the debian package the time module should be there ootb. Regards Michael .-.. .. ...- . .-.. --- -. --. .- -. -.. .--. .-. --- ... .--. . .-. Space: the final frontier. These are the voyages of the starship Enterprise. Its five-year mission: to explore strange new worlds; to seek out new life and new civilizations; to boldly go where no man has gone before. -- Captain James T. Kirk
[toc] | [prev] | [next] | [standalone]
| From | lists@rickv.com |
|---|---|
| Date | 2017-01-08 19:40 +0100 |
| Message-ID | <sXqxP-1C6-3@gated-at.bofh.it> |
| In reply to | #176431 |
re 2: time is in the Python standard library; you should have it. re 1: It's not a bad thing to use a separate package manager for your Python projects if you're getting into development with Python. More or less, users simply maintaining a system that uses Python should be OK with installs from the repo. If developing in Python, a package manager that integrates with virtual environments will help because it isolates dependencies for each specific project (which you would develop in its own environment). I'm sorry I can't answer you about conda, but this setup is general practice with PyPI; with that you make and activate a virtual environment for your project, then install packages with the command `pip` (no backticks, but I'm not sure how best to note inline code on a mailing list). Then, for instance, if a different project requires a different package version, your other project depending on another version won't break. If then you want that Python sript/module running on your main system, you can do the desired dependency installs from the Debian repo. On Sat, Jan 07, 2017 at 08:29:05PM -0700, Joe Pfeiffer wrote: >I'm starting to try to learn pythonOCC (a wrapper on the OpenCascade 3d >modeling library) as an excuse to learn python itself, and am running >into some problems right off the bat. > >(1) pythonOCC wants to be installed using a package manager called > conda (see http://www.pythonocc.org/download/ and > https://www.continuum.io/). Is there a reasonably standard way to > integrate conda with apt (in the same sense that alien will let me > install an RPM), or do I just sort of have to expect to use a > different system for it? Yes, I can download from source instead, > and may end up taking that approach, but would rather not if I can > avoid it. > >(2) More seriously, I'm getting the following error and traceback trying > to run my very first script: > >nowball:13$ python box1.py >Traceback (most recent call last): > File "box1.py", line 1, in <module> > from OCC.Display.SimpleGui import init_display > File "/home/joseph/python/lib/python2.7/site-packages/OCC/Display/SimpleGui.py", line 20, in <module> > import logging > File "/usr/lib/python2.7/logging/__init__.py", line 26, in <module> > import sys, os, time, cStringIO, traceback, warnings, weakref, collections >ImportError: No module named time > >>From everything I'm finding, it looks like both the logging and time >modules should be installed by default with python; what do I need to >install that is missing at present to get the time module? > -- Rick Valenzuela Videojournalist Shanghai, China +86 185 0177 0138 rick@rickv.com GPG: 0x054124ADD5644029
[toc] | [prev] | [next] | [standalone]
| From | Rick Valenzuela <rick@rickv.com> |
|---|---|
| Date | 2017-01-08 20:40 +0100 |
| Message-ID | <sXrtU-2gK-15@gated-at.bofh.it> |
| In reply to | #176461 |
>On Sat, Jan 07, 2017 at 08:29:05PM -0700, Joe Pfeiffer wrote: >>(2) More seriously, I'm getting the following error and traceback trying >> to run my very first script: >> >>nowball:13$ python box1.py >>Traceback (most recent call last): >> File "box1.py", line 1, in <module> >> from OCC.Display.SimpleGui import init_display >> File "/home/joseph/python/lib/python2.7/site-packages/OCC/Display/SimpleGui.py", line 20, in <module> >> import logging >> File "/usr/lib/python2.7/logging/__init__.py", line 26, in <module> >> import sys, os, time, cStringIO, traceback, warnings, weakref, collections >>ImportError: No module named time >> >>>From everything I'm finding, it looks like both the logging and time >>modules should be installed by default with python; what do I need to >>install that is missing at present to get the time module? Going from the first line in the traceback, does box1.py have a line that says `import time`? To save space in your project, not all things in the standard library are pulled in to every project. You have to declare you need it. And I'm sorry for top-posting before. -- Rick Valenzuela Videojournalist Shanghai, China
[toc] | [prev] | [next] | [standalone]
| From | Nicolas George <george@nsup.org> |
|---|---|
| Date | 2017-01-08 21:50 +0100 |
| Message-ID | <sXszD-2Yn-7@gated-at.bofh.it> |
| In reply to | #176461 |
[Multipart message — attachments visible in raw view] — view raw
Le nonidi 19 nivôse, an CCXXV, lists@rickv.com a écrit : > re 1: It's not a bad thing to use a separate package manager for your > Python projects if you're getting into development with Python. Actually, it is a bad thing. Package managers specialized for one language are convenient for the developers heavily involved in that language, but for everybody else they are a terrible thing. For one, they do not integrate with the system package manager and its security updates. People usually remember to do the security updates, but they never remember to update the programs installed separately, and even more so the libraries that were installed automatically. Second, and this is more insidious: by giving developers too much control over the versions of the libraries, they lead them to be careless with compatibility. That means they will easily depend on a very bleeding-edge version of a library, or on an older one that is no longer maintained for security. In both cases, it is very annoying for the end users. The language-specific package systems came to exist because of a flaw in most distros: it is impossible to install specific packages as simple users, nor without risking to break the whole system. But they are a bad solution to a real problem. Unfortunately, now they exist. And unfortunately, Debian still suffers from the flaw. That means sometimes using the language-specific package systems is unavoidable. But developers need to be aware of the issue to try and mitigate its consequences. In particular, whenever possible, they should use the libraries present as real packages in stable. Regards, -- Nicolas George
[toc] | [prev] | [next] | [standalone]
| From | lists@rickv.com |
|---|---|
| Date | 2017-01-08 23:50 +0100 |
| Message-ID | <sXurL-4bG-5@gated-at.bofh.it> |
| In reply to | #176470 |
On Sun, Jan 08, 2017 at 09:49:24PM +0100, Nicolas George wrote: >Le nonidi 19 nivôse, an CCXXV, lists@rickv.com a écrit : >> re 1: It's not a bad thing to use a separate package manager for your >> Python projects if you're getting into development with Python. > >Actually, it is a bad thing. Package managers specialized for one >language are convenient for the developers heavily involved in that >language, but for everybody else they are a terrible thing. > Oh, I can see your point from your reasoning. I can amend my comment to 'It doesn't have to be a bad thing to use a separate package manager.' It all depends on the use case and the goals. If the scope of these are on a stable Debian system, you're totally right. If the OP, or any other Debian user, is developing to contribute primarily to Python users and the Python community, pip makes more sense. Whether a developer is maintaining good update habits from there is largely a matter of how they learned. Best regards, Rick -- Rick Valenzuela Videojournalist Shanghai, China
[toc] | [prev] | [standalone]
Back to top | Article view | linux.debian.user
csiph-web