Traceback (most recent call last):import My_Working_File
================================ RESTART ================================ >>>
import My_Working_File
['', 'D:\\Shades\\Tools\\Python\\Lib\\idlelib', 'D:\\Shades\\Tools\\Python\\python34.zip', 'D:\\Shades\\Tools\\Python\\DLLs', 'D:\\Shades\\Tools\\Python\\lib', 'D:\\Shades\\Tools\\Python', 'D:\\Shades\\Tools\\Python\\lib\\site-packages', 'D:\\Shades\\Tools\\Python\\MyWork']import sys
sys.path.append(r'D:\Shades\Tools\Python\MyWork')
print(sys.path)
import My_Working_File
I don't really want to go this route every time I start work, and more to the >point I will need (to learn how) to add dir's to the path at times
On 14 May 2023, at 16:32, Grizzy Adams via Python-list <python-list@python.org> wrote:
Hi All
My first post (repeated)
I am having a problem with PythonPath / sys.path
I have a dir where I keep all my current work, but I can't seem to add it to PythonPath / sys.path
When I try to import one of my modules I see
Traceback (most recent call last):import My_Working_File
File "<pyshell#0>", line 1, in <module>
import My_Working_File
ImportError: No module named 'My_Working_File'
I have tried adding my dir in registry to the existing PythonPath
[HKEY_CURRENT_USER\Software\Python\PythonCore\3.4\PythonPath] @="D:\\Shades\\Tools\\Python\\Lib;D:\\Shades\\Tools\\Python\\DLLs"
that did not help,
I tried adding PYTHONPATH as an enviramental variable, that also had no effect
(I did re-boot after these two tests)
If I go to the editor window and run (F5) any of my modules then I can
================================ RESTART ================================ >>>>
import My_Working_File
without error
I can also (from a fresh start)
['', 'D:\\Shades\\Tools\\Python\\Lib\\idlelib', 'D:\\Shades\\Tools\\Python\\python34.zip', 'D:\\Shades\\Tools\\Python\\DLLs',import sys
sys.path.append(r'D:\Shades\Tools\Python\MyWork')
print(sys.path)
'D:\\Shades\\Tools\\Python\\lib', 'D:\\Shades\\Tools\\Python', 'D:\\Shades\\Tools\\Python\\lib\\site-packages', 'D:\\Shades\\Tools\\Python\\MyWork']
import My_Working_File
I don't really want to go this route every time I start work, and more to the
point I will need (to learn how) to add dir's to the path at times
I did search the net for an answer but only got what I had already tried
any pointers what I'm doing wrong (other than using windows '->)
Grizz
--
https://mail.python.org/mailman/listinfo/python-list
I take it you have business reasons to use an obsolete version python.
Where did you get your version of python from?
On 5/14/23 10:43, Barry wrote:
I take it you have business reasons to use an obsolete version python.
Where did you get your version of python from?
In fact, a *nine* year old version of Python that reached end-of-life
four years ago.
Just sayin'
Python version shouldn't have anything to do with the sys.path, though.
Sunday, May 14, 2023 at 11:11, Mats Wichmann wrote:
Re: PythonPath / sys.path (at least in part)
On 5/14/23 10:43, Barry wrote:
I take it you have business reasons to use an obsolete version python.
Where did you get your version of python from?
In fact, a *nine* year old version of Python that reached end-of-life
four years ago.
Just sayin'
Python version shouldn't have anything to do with the sys.path, though.
I must have slept a while
Python 3.4.10 (default, Jul 14 2019, 14:41:03) [MSC v.1600 32 bit (Intel)] on win32
Actually I did have 3..4.3 when I asked the question (first time) because I could only find 3.4.10 as src and did not feel I was able to compile it with any certainty ;->)
I have since moved up (a little) so only ~4 years old, I then updated pip from
9.x to 19.1
reason its an old version is it's an old PC (XpPro), if I start to get passable
at this I will try it on my Ubuntu box which is running 22.04 (latest LTS) and
23.04, (23.10 daily builds soon) I took a look and it seems I "may" have to play a little to get IDLE on (if it's not in the normal repo's)
I have tried adding my dir in registry to the existing PythonPath
[HKEY_CURRENT_USER\Software\Python\PythonCore\3.4\PythonPath] @="D:\\Shades\\Tools\\Python\\Lib;D:\\Shades\\Tools\\Python\\DLLs"
that did not help,
Sunday, May 14, 2023 at 11:11, Mats Wichmann wrote:[snip]
Re: PythonPath / sys.path (at least in part)
I have since moved up (a little) so only ~4 years old, I then updated pip from
9.x to 19.1
reason its an old version is it's an old PC (XpPro), if I start to get passable
at this I will try it on my Ubuntu box which is running 22.04 (latest LTS) and
23.04, (23.10 daily builds soon) I took a look and it seems I "may" have to play a little to get IDLE on (if it's not in the normal repo's)
I seem to have managed to sort "PythonPath / sys.path" the environment variable
is working, so I can now import my_work without any other hassle, which is good, now I find that some of the files which worked a treat from GUI, Editor (F5) or terminal but don't do the same once saved and imported later, I'm sure
it's me, I have come from VB/VBA, Delphi and a (very) little C++, and am still
working through the python tutorial, trying not to skip ahead (ok I did skip "Hello World" :->) so I may end up asking some (senior moment) newbie questions, I will try hard to work it out myself first
Thanks to all who got me thus far
You made a little slam against Windows, but you will find it harder to
get things working on Linux. Ubuntu, like many other Linux distros,
does not come with pip and Tk (needed for Idle) installed, and it's not
so obvious how to install them.
On Mon, 15 May 2023 at 09:22, Thomas Passin <list1@tompassin.net> wrote:
You made a little slam against Windows, but you will find it harder to
get things working on Linux. Ubuntu, like many other Linux distros,
does not come with pip and Tk (needed for Idle) installed, and it's not
so obvious how to install them.
The assumption on Linux is usually that you know how to use your
system's package manager. And on Debian and Ubuntu specifically, it's
about as easy as you would want: "apt install idle". That'll pull in everything you should need. I don't know about other distros but I
would expect that it's approximately as easy.
Maybe that's not obvious if you come from Windows, but I'd guess that
most desktop Linux users will have at least a passing familiarity with
their package manager, making this a perfectly obvious way to get new software.
Well, no, why would you assume that? I started to use Linux - in VMs - because I had to make sure that my cross-platform java/jython Tomcat
program would work right on Linux. Why, for example, would I think to install Idle from the package manager when it, or things like that, were always in my experience installed with pip? For that matter, "sudo
apt-get install pip" won't install pip. You need to use a different
name, and it may or may not be different for different distros.
On Mon, 15 May 2023 at 12:07, Thomas Passin <list1@tompassin.net> wrote:
Well, no, why would you assume that? I started to use Linux - in VMs -
because I had to make sure that my cross-platform java/jython Tomcat
program would work right on Linux. Why, for example, would I think to
install Idle from the package manager when it, or things like that, were
always in my experience installed with pip? For that matter, "sudo
apt-get install pip" won't install pip. You need to use a different
name, and it may or may not be different for different distros.
If you EVER had to install something other than a Python package, you
would have had to make use of the system package manager. You're
right, there are multiple obvious ways to install Idle, but that
doesn't mean that the package manager isn't one of them.
On 15 May 2023, at 05:39, Thomas Passin <list1@tompassin.net> wrote:Personally, I don't find it easy to scroll through hundreds of lines in the synaptics search results looking for something whose name I can only partly guess at. If I know the command line equivalent for a search, I could do a grep and that would
On 5/14/2023 11:08 PM, Chris Angelico wrote:
On Mon, 15 May 2023 at 12:07, Thomas Passin <list1@tompassin.net> wrote: >>> Well, no, why would you assume that? I started to use Linux - in VMs -If you EVER had to install something other than a Python package, you
because I had to make sure that my cross-platform java/jython Tomcat
program would work right on Linux. Why, for example, would I think to
install Idle from the package manager when it, or things like that, were >>> always in my experience installed with pip? For that matter, "sudo
apt-get install pip" won't install pip. You need to use a different
name, and it may or may not be different for different distros.
would have had to make use of the system package manager. You're
right, there are multiple obvious ways to install Idle, but that
doesn't mean that the package manager isn't one of them.
Yes, after a while I came to realize that missing Python pieces might be available from the package manager. That doesn't mean it's obvious, or easy to discover just what names to use. And sometimes one has to add a new external repository.
Anyway, there's no point in trying to convince me that I could have understood everything at the start that I may have learned later. I'm just interested in passing on things I've learned along that way that a newcomer to Python in Linux may notrealize.
--
https://mail.python.org/mailman/listinfo/python-list
On 5/14/2023 11:08 PM, Chris Angelico wrote:
On Mon, 15 May 2023 at 12:07, Thomas Passin <list1@tompassin.net> wrote:
Well, no, why would you assume that? I started to use Linux - in VMs -
because I had to make sure that my cross-platform java/jython Tomcat
program would work right on Linux. Why, for example, would I think to
install Idle from the package manager when it, or things like that, were >> always in my experience installed with pip? For that matter, "sudo
apt-get install pip" won't install pip. You need to use a different
name, and it may or may not be different for different distros.
If you EVER had to install something other than a Python package, you
would have had to make use of the system package manager. You're
right, there are multiple obvious ways to install Idle, but that
doesn't mean that the package manager isn't one of them.
Yes, after a while I came to realize that missing Python pieces might be available from the package manager. That doesn't mean it's obvious, or
easy to discover just what names to use.
And sometimes one has to add a
new external repository.
Personally, I don't find it easy to scroll
through hundreds of lines in the synaptics search results looking for something whose name I can only partly guess at.
If I know the command
line equivalent for a search, I could do a grep and that would probably
be more focused.
But trying to work with a dozen different distros
because various clients might use them - it's hard to keep details straight.
Anyway, there's no point in trying to convince me that I could have understood everything at the start that I may have learned later. I'm
just interested in passing on things I've learned along that way that a newcomer to Python in Linux may not realize.
Ubuntu, like many other Linux distros,
does not come with pip and Tk (needed for Idle) installed, and it's not
so obvious how to install them.
Personally, I don't find it easy to scroll through hundreds of lines in the synaptics search results looking for something whose name I can only partly guess at. If I know the command line equivalent for a search, I could do a grep and that wouldOn 15 May 2023, at 05:39, Thomas Passin <list1@tompassin.net> wrote:
On 5/14/2023 11:08 PM, Chris Angelico wrote:
On Mon, 15 May 2023 at 12:07, Thomas Passin <list1@tompassin.net> wrote: >>>> Well, no, why would you assume that? I started to use Linux - in VMs - >>>> because I had to make sure that my cross-platform java/jython TomcatIf you EVER had to install something other than a Python package, you
program would work right on Linux. Why, for example, would I think to >>>> install Idle from the package manager when it, or things like that, were >>>> always in my experience installed with pip? For that matter, "sudo
apt-get install pip" won't install pip. You need to use a different
name, and it may or may not be different for different distros.
would have had to make use of the system package manager. You're
right, there are multiple obvious ways to install Idle, but that
doesn't mean that the package manager isn't one of them.
Yes, after a while I came to realize that missing Python pieces might be available from the package manager. That doesn't mean it's obvious, or easy to discover just what names to use. And sometimes one has to add a new external repository.
realize.
Anyway, there's no point in trying to convince me that I could have understood everything at the start that I may have learned later. I'm just interested in passing on things I've learned along that way that a newcomer to Python in Linux may not
Being a Fedora user i needed to learn how to install missing pieces of pyrhon on ubuntu.
We searches for:
ubuntu install pip
Ubuntu install idle
Both provide lots of answers. Did your searches fail to turn up answers?
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 300 |
Nodes: | 16 (2 / 14) |
Uptime: | 75:35:29 |
Calls: | 6,716 |
Calls today: | 4 |
Files: | 12,246 |
Messages: | 5,357,399 |