On Feb 16, 2017, at 9:55 PM, Rustom Mody wrote:
> On Friday, February 17, 2017 at 3:24:32 AM UTC+5:30, Terry Reedy wrote:
>> On 2/15/2017 7:42 AM, poseidon wrote:
>>
>>> what are pth files for?
>>
>> They are for extending (mainly) lib/site-packages.
&g
On Friday, February 17, 2017 at 3:24:32 AM UTC+5:30, Terry Reedy wrote:
> On 2/15/2017 7:42 AM, poseidon wrote:
>
> > what are pth files for?
>
> They are for extending (mainly) lib/site-packages.
Hey Terry!
This needs to get into more public docs than a one-off post
On 2/15/2017 7:42 AM, poseidon wrote:
what are pth files for?
They are for extending (mainly) lib/site-packages. To repeat what I
have posted before: every time I install a new version of Python, I add
(copy) python.pth containing 'F:/python' (without the quotes). This
py3/src in the
> >>> site-packages dir:
> >>>
> >>> ln -s /home/poseidon/tau4/swr/py3/src
> >>> /usr/lib/python3.6/site-packages/tau4
> >>>
> >>
> >> Well this works because now Python finds (following the symlink) a tau4
&
Le mercredi 15 février 2017 10:34:42 UTC-5, Steve D'Aprano a écrit :
> On Wed, 15 Feb 2017 11:42 pm, poseidon wrote:
>
> > Yes, removed it (symlink still there) and it still works. But then, what
> > are pth files for?
>
>
> Good question. I don't actuall
On Wed, 15 Feb 2017 11:42 pm, poseidon wrote:
> Yes, removed it (symlink still there) and it still works. But then, what
> are pth files for?
Good question. I don't actually know anyone that uses pth files, so perhaps
they're unnecessary.
But the principle behind them is that
till works. But then, what
are pth files for? I'd just place a symlink to the package and am done
with. The path doesn't seem to be needed in sys.path (where it would go
if placed in a pth file). If I write
from tau4 import datalogging
that works, too. So no need for the path being in sys
ecause now Python finds (following the symlink) a tau4
package (i.e., a directory with that name and an __init__.py file
inside) in /usr/lib/python3.6/site-packages. The .pth file is not
involved in this at all.
Yes, removed it (symlink still there) and it still works. But then, what
are pth files for
symlink) a tau4
package (i.e., a directory with that name and an __init__.py file
inside) in /usr/lib/python3.6/site-packages. The .pth file is not
involved in this at all.
Yes, removed it (symlink still there) and it still works. But then, what
are pth files for? I'd just place a symlink to
ctory with that name and an __init__.py file
inside) in /usr/lib/python3.6/site-packages. The .pth file is not
involved in this at all.
https://docs.python.org/3.6/library/site.html suggests that PTH files
only work relative to the site-packages dir. But digging around in e.g.
StackOverflow
hat
/home/poseidon/tau4/swr/py3/src is in sys.path, I get a ModuleNotFoundError.
It works, if I set a symlink to /home/poseidon/tau4/swr/py3/src in the
site-packages dir:
ln -s /home/poseidon/tau4/swr/py3/src /usr/lib/python3.6/site-packages/tau4
https://docs.python.org/3.6/library/site.html suggest
En Sun, 02 Oct 2011 18:29:24 -0300, Andrea Gavana
escribió:
Let's say I am using a package called "blah", and this package is already
installed on site-packages (and I need it to be there) with a name
"blah-1.2-win". In the site-packages folder, there is a pth file called
"blah.pth" which con
On 10/02/2011 10:29 PM, Andrea Gavana wrote:
> Hi All,
> my apologies if this is a dumb question, but I couldn't find a
> solution - possibly because I am not sure how to state my problem in
> a short sentence.
I think this (and such) are important questions and I too await
answers.
It seem
On 10/02/2011 10:29 PM, Andrea Gavana wrote:
Hi All,
my apologies if this is a dumb question, but I couldn't find a
solution - possibly because I am not sure how to state my problem in
a short sentence.
Let's say I am using a package called "blah", and this package is
already installed
Hi All,
my apologies if this is a dumb question, but I couldn't find a solution
- possibly because I am not sure how to state my problem in a short
sentence.
Let's say I am using a package called "blah", and this package is already
installed on site-packages (and I need it to be there) with
On Sat, Aug 27, 2011 at 10:42 AM, Josh English
wrote:
> According to the docs, I should be able to put a file in the site-packages
> directory called xmldb.pth pointing anywhere else on my drive to include the
> package. I'd like to use this to direct Python to include the version in the
> dev
I am developing a library for Python 2.7. I'm on Windows XP. I am also learning
the "proper" way to do this (per PyPi) but not in a linear fashion: I've built
a prototype for the library, created my setup script, and run the install to
make sure I had that bit working properly.
Now I'm continu
* Tim Johnson [110325 12:59]:
> Hello: I'm trying to put together a test platform on a slax OS.
> Python 2.7 packages appear to be at /user/lib/python2.7.
>
> Where is the appropriate place to put a .pth file?
I must have stumped the chumps. And this chump hasn't used
Hello: I'm trying to put together a test platform on a slax OS.
Python 2.7 packages appear to be at /user/lib/python2.7.
Where is the appropriate place to put a .pth file?
Note, I have django on this system too, but slax does not resolved
system paths. And that is 'slax' not 'slack'.
--
Tim
tim
I am not understanding why paths I'm adding to a virtualenv via
add2virtualenv are not working. I use this in plenty of other situations,
but in this one project (which is on 3.2) I am getting strange behavior.
~/projects/fooproject/# add2virtualenv src/
~/projects/fooproject/# python3 -c "impor
\site-packages' or 'c:\\python26', but
according to the documentation it should work for all of the above
locations. Any ideas??
I'm running Python 2.6.4 on WinXP
It's a long standing documentation bug - not every directory in sys.path
is searched for .pth files, on
Python's documentation (http://docs.python.org/install/
index.html#modifying-python-s-search-path) states that we can add more
locations to python's module search path by
"add a path configuration file to a directory that’s already on
Python’s path, usually to the .../site-packages/ directory"
sys
way...
import os, site
smsc = os.environ.get("TECHROOT", "/home/tech")
if not os.path.isdir(smsc):
smsc = "/home/tech"
site.addsitedir (os.path.join(smsc,
"tools/python/Linux/%arch/lib/python2.5/site-packages"))
No for .pth files this needs to be
On Tue, 9 Jun 2009 21:33:56 -0700 (PDT), rh0dium
wrote:
>> Having multiple paths or multiple .PTH files isn't a
>> problem for python.
> ..
> We use it for our dev tree before we roll to production. Once dev is
> QA'd then we (integrate) those changes to
On Jun 9, 4:58 pm, David Lyon wrote:
> On Tue, 9 Jun 2009 16:30:06 -0700 (PDT), rh0dium
> wrote:
>
> >> > Apparently there is a problem with the if statement???
>
> >> > Thanks
>
> > No for .pth files this needs to be on a single line..
>
&g
On Jun 9, 9:19 pm, alex23 wrote:
> On Jun 10, 8:00 am, rh0dium wrote:
>
> > Apparently there is a problem with the if statement???
>
> Try restructuring the if as a ternary condition:
>
> import os, site; smsc = os.environ.get("TECHROOT", "/home/tech"); smsc
> = smsc if os.path.isdir(smsc) else "
On Jun 10, 8:00 am, rh0dium wrote:
> Apparently there is a problem with the if statement???
Try restructuring the if as a ternary condition:
import os, site; smsc = os.environ.get("TECHROOT", "/home/tech"); smsc
= smsc if os.path.isdir(smsc) else "/home/tech"; site.addsitedir
(os.path.join(smsc,
On Tue, 9 Jun 2009 16:30:06 -0700 (PDT), rh0dium
wrote:
>> > Apparently there is a problem with the if statement???
>>
>> > Thanks
>
> No for .pth files this needs to be on a single line..
I can't really see why you need conditional code...
If you want to a
uot;; site.addsitedir
> > (os.path.join(smsc, "tools/python/Linux/%arch/lib/python2.5/site-
> > packages"))
>
> Try it this way...
>
> import os, site
> smsc = os.environ.get("TECHROOT", "/home/tech")
> if not os.path.isdir(smsc):
> sms
On 6/9/2009 3:00 PM rh0dium said...
I have a .pth file which has some logic in it - but it isn't quite
enough...
It started with this..
import os, site; site.addsitedir(os.path.join(os.environ["TECHROOT"],
"tools/python/modules"))
But that eventually evolved into..
import os, site; site.addsite
I have a .pth file which has some logic in it - but it isn't quite
enough...
It started with this..
import os, site; site.addsitedir(os.path.join(os.environ["TECHROOT"],
"tools/python/modules"))
But that eventually evolved into..
import os, site; site.addsitedir(os.path.join(os.environ.get
("TECH
At 04:42 PM 5/9/2009 +0200, Martin v. Löwis wrote:
>> If you always use --single-version-externally-managed with easy_install,
>> it will stop editing .pth files on installation.
>
> It's --multi-version (-m) that does that.
> --single-version-externally-managed is a
> GNU stow does handle these issues.
If GNU stow solves all your problems, why do you want to
use easy_install in the first place?
Regards,
Martin
--
http://mail.python.org/mailman/listinfo/python-list
On May 9, 2009, at 9:39 AM, P.J. Eby wrote:
It would be really straightforward, though, for someone to
implement an easy_install variant that does this. Just invoke
"easy_install -Zmaxd /some/tmpdir packagelist" to get a full set of
unpacked .egg directories in /some/tmpdir, and then move
> Ah, ok. Is there also an easy_install invocation that unpacks the zip
> file into some location of sys.path (which then wouldn't require
> editing sys.path)?
You have pip that does that :)
--
дамјан ( http://softver.org.mk/damjan/ )
... knowledge is exactly like power - something
to be dist
At 04:42 PM 5/9/2009 +0200, Martin v. Löwis wrote:
>> If you always use --single-version-externally-managed with easy_install,
>> it will stop editing .pth files on installation.
>
> It's --multi-version (-m) that does that.
> --single-version-externally-managed is a
>> If you always use --single-version-externally-managed with easy_install,
>> it will stop editing .pth files on installation.
>
> It's --multi-version (-m) that does that.
> --single-version-externally-managed is a "setup.py install" option.
>
> Both
At 04:18 PM 5/9/2009 +0200, Martin v. Löwis wrote:
Zooko O'Whielacronx wrote:
> .pth files are why I can't easily use GNU stow with easy_install.
> If installing a Python package involved writing new files into the
> filesystem, but did not require reading, updating, and re-w
Zooko O'Whielacronx wrote:
> .pth files are why I can't easily use GNU stow with easy_install.
> If installing a Python package involved writing new files into the
> filesystem, but did not require reading, updating, and re-writing any
> extant files such as .pth files, th
.pth files are why I can't easily use GNU stow with easy_install.
If installing a Python package involved writing new files into the
filesystem, but did not require reading, updating, and re-writing any
extant files such as .pth files, then GNU stow would Just Work with
easy_install the w
Chris Withers wrote:
I'll say! I think .pth files are absolute evil and I wish they could
just be banned.
+1 on anything that makes them closer to going away or reduces the
possibility of yet another similar feature from hurting the
comprehensibility of a python setup.
I've seen
r the site-python or site-packages directory....
I'll say! I think .pth files are absolute evil and I wish they could
just be banned.
+1 on anything that makes them closer to going away or reduces the
possibility of yet another similar feature from hurting the
comprehensibility of a python s
packages directory.
...
A typical installation should have no or very few .pth files or something is
wrong, and if you need to play with the search order, something is very wrong.
"""
I'll say! I think .pth files are absolute evil and I wish they could
just be banned.
+1 on
also be used to feed .pth files) and/or via special named files
such as ~/.python2.6-user.pth or ./python2.6-local.pth, or possibly
even reusing the paths in the distutils configuration files (under
[install]).
Any path in the above files would be added to sys.path and scanned
recursively for other
gt;> escribió:
>> > I have more information now. It seems that it recurses the .pth files
>> > it finds in PYTHONPATH but not for directories found in the .pth files
>> > in site-packages. Is this expected behaviour? The documentation
>> > suggests
On Tue, 26 Feb 2008 03:01:33 -0200
"Gabriel Genellina" <[EMAIL PROTECTED]> wrote:
> En Sat, 23 Feb 2008 12:52:45 -0200, D'Arcy J.M. Cain <[EMAIL PROTECTED]>
> escribió:
> > I have more information now. It seems that it recurses the .pth files
> > i
>> working in a location not in the ServerRoot but if I use the main site
>> it does not pick up the directories in the included .pth.
>
> I have more information now. It seems that it recurses the .pth files
> it finds in PYTHONPATH but not for directories found in the .pth fil
ncluded .pth.
I have more information now. It seems that it recurses the .pth files
it finds in PYTHONPATH but not for directories found in the .pth files
in site-packages. Is this expected behaviour? The documentation
suggests that it should pick up both.
--
D'Arcy J.M. Cain <[EMAIL PRO
the .pth files
sometimes and not others?
--
D'Arcy J.M. Cain <[EMAIL PROTECTED]> | Democracy is three wolves
http://www.druid.net/darcy/| and a sheep voting on
+1 416 425 1212 (DoD#0082)(eNTP) | what's for dinner.
--
http://mail.python.org/
On Jul 12, 7:20 am, John Machin <[EMAIL PROTECTED]> wrote:
> On Jul 12, 9:55 pm, samwyse <[EMAIL PROTECTED]> wrote:
>
> > On Jul 8, 3:53 pm, John Machin <[EMAIL PROTECTED]> wrote:
>
> > > I got the impression that the OP was suggesting that the interpreter
> > > look in the directory in which it fo
On Jul 8, 3:53 pm, John Machin <[EMAIL PROTECTED]> wrote:
> I'm curious whether you think that the OP's use of ".pth" was a typo,
> and whether you have read this:
>http://docs.python.org/lib/module-site.html
I've read it, but not recently; the syntax of the .pyh files was in
the back of my h
On Jul 12, 9:55 pm, samwyse <[EMAIL PROTECTED]> wrote:
> On Jul 8, 3:53 pm, John Machin <[EMAIL PROTECTED]> wrote:
>
>
>
> > I got the impression that the OP was suggesting that the interpreter
> > look in the directory in which it found the script.
> [...]
> > I got the impression that the problem
On Jul 8, 3:53 pm, John Machin <[EMAIL PROTECTED]> wrote:
> I got the impression that the OP was suggesting that the interpreter
> look in the directory in which it found the script.
[...]
> I got the impression that the problem was that the package was not
> only not on sys.path but also not in t
John Machin wrote:
> I got the impression that the OP was suggesting that the interpreter
> look in the directory in which it found the script.
Right.
> I got the impression that the problem was that the package was not
> only not on sys.path but also not in the same directory as the script
> t
On Jul 8, 10:53 pm, samwyse <[EMAIL PROTECTED]> wrote:
> On Jul 3, 9:35 am, Alan Isaac <[EMAIL PROTECTED]> wrote:
>
> > Suppose I have a directory `scripts`.
> > I'd like the scripts to have access to a package
> > that is not "installed", i.e., it is not on sys.path.
> > On this list, various peop
On Jul 3, 9:35 am, Alan Isaac <[EMAIL PROTECTED]> wrote:
> Suppose I have a directory `scripts`.
> I'd like the scripts to have access to a package
> that is not "installed", i.e., it is not on sys.path.
> On this list, various people have described a variety
> of tricks they use, but nobody has pr
> On Jul 3, 7:35 am, Alan Isaac <[EMAIL PROTECTED]> wrote:
>>Suppose I have a directory `scripts`.
>>I'd like the scripts to have access to a package
>>that is not "installed", i.e., it is not on sys.path.
>>On this list, various people have described a variety
>>of tricks they use, but nobody has
On Jul 3, 7:35 am, Alan Isaac <[EMAIL PROTECTED]> wrote:
> Suppose I have a directory `scripts`.
> I'd like the scripts to have access to a package
> that is not "installed", i.e., it is not on sys.path.
> On this list, various people have described a variety
> of tricks they use, but nobody has pr
Suppose I have a directory `scripts`.
I'd like the scripts to have access to a package
that is not "installed", i.e., it is not on sys.path.
On this list, various people have described a variety
of tricks they use, but nobody has proposed a
pretty way to allow this.
I am therefore assuming there i
This one I do not understand -- does anyone have any suggestions?
Newly compiled untweaked Python2.5 is not processing .pth files (as
far as I can see _any_ .pth files in site-packages. Example:.
+++
[EMAIL PROTECTED]:/usr/local/lib/python2.5/site-packages$ ls setup*
-rw-r--r-- 1
nd lib/site-python) are actually scanned for .pth files, plus any paths
added as a result of parsing .pth files that are found.
If you want to modify or extend this behaviour, you should take
advantage of sitecustomize.py by adding your own behaviour, perhaps
scanning os.environ['PYTH
Benjamin Rutt wrote:
> Am I correct in understanding that:
>
> 1) foo.pth will be used if it is in the directory
> /usr/lib/python-2.4/site-packages
>
> 2) foo.pth will not be read from if it is only placed somewhere in the
> PYTHONPATH environment, such as foo.pth exists as the file
> /tmp/bar/f
Am I correct in understanding that:
1) foo.pth will be used if it is in the directory
/usr/lib/python-2.4/site-packages
2) foo.pth will not be read from if it is only placed somewhere in the
PYTHONPATH environment, such as foo.pth exists as the file
/tmp/bar/foo.pth, where PYTHONPATH contains "/t
Peter Hansen schrieb:
> Peter Maas wrote:
>> But sitecustomize.py changes the Python installation, doesn't it?
>> This wouldn't be an advantage over putting a .pth file into
>> .../site-packages.
>
>
> You can have a local sitecustomize.py in the current directory, which
> wouldn't change the Py
Michael Ekstrand schrieb:
> If top/ is the working directory for your Python interpreter, the
> problem is solved automatically. Python puts the current working
> directory in the default search path. So, if you run
IIS sets the the site path as working directory. So I would probably
have to chang
As far as I can tell, the current directory isn't added to the sys.path
until after site.py executes, so I don't believe you can rely on .pth
files to do anything like what you want. Sitecustomize.py is it, with
appropriate smarts inside.
-Peter
--
http://mail.python.org/mailman/listinfo/python-list
in mod2.py no matter what the
> absolute path of top is. To achieve this I start install.py once to
> retrieve the absolute dir of itself (= abspath of top/) and creates
> .pth files with its absolute dir in every subdirectory.
If top/ is the working directory for your Python interpr
ath of top is. To achieve this I start install.py once to
retrieve the absolute dir of itself (= abspath of top/) and creates
.pth files with its absolute dir in every subdirectory.
> but
> generally such non-standard sys.path and .pth manipulations are best
> handled by a sitecustomize.p
Peter Maas wrote:
> My goal is to have the top level of a directory tree in the Python
> path without touching anything outside the directory. I tried to
> create .pth files with the top level path in every subdirectory
> but this doesn't work despite working directory being par
My goal is to have the top level of a directory tree in the Python
path without touching anything outside the directory. I tried to
create .pth files with the top level path in every subdirectory
but this doesn't work despite working directory being part of the
Python path.
Creating the pth
Neil Benn wrote:
>* Site.py is prompted to load a sitecustomise.py file which is
> located in the Lib directory - if it is there. This file is
> automatically executed on the start up of python. Here you can
> look for a command line argument (or a local config file) passed
>
Sylvain Thenault wrote:
>On Tue, 09 Aug 2005 09:37:47 +, Adriano Varoli Piazza wrote:
>
>
>
>>Sylvain Thenault ha scritto:
>>
>>
>>>Hi there !
>>>
>>>I've some questions regarding pth files (which btw are undocumented in
&g
Richie Hindle wrote:
> http://google.com/search?q=site:docs.python.org%20pth
>
> The first hit explains how .pth files work (although it's the sort of
> documentation that makes Xah Lee explode with fury).
That just makes it all the more delicious.
--
Erik Max Francis &a
[Sylvain]
> I've some questions regarding pth files (which btw are undocumented in the
> python reference, is this intentional ?)
http://google.com/search?q=site:docs.python.org%20pth
The first hit explains how .pth files work (although it's the sort of
documentation that makes
On Tue, 09 Aug 2005 09:37:47 +, Adriano Varoli Piazza wrote:
> Sylvain Thenault ha scritto:
>> Hi there !
>>
>> I've some questions regarding pth files (which btw are undocumented in
>> the python reference, is this intentional ?)
>>
>> I though
Sylvain Thenault ha scritto:
> Hi there !
>
> I've some questions regarding pth files (which btw are undocumented in the
> python reference, is this intentional ?)
>
> I thought that I could use a .pth file to be able to import zope products
> from both INSTANCE_HOME/
Hi there !
I've some questions regarding pth files (which btw are undocumented in the
python reference, is this intentional ?)
I thought that I could use a .pth file to be able to import zope products
from both INSTANCE_HOME/Products and ZOPE_HOME/lib/python/Products from
outside zope:
[
>> I have a mojam.pth file but no "mojam" package on my server. Works
>> just fine.
Ben> Where does it call home? site-packages?
Yup.
--
http://mail.python.org/mailman/listinfo/python-list
On 22 Mar 2005 09:29:39 -0800, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
>I'm unclear on how .pth files work. Some posts imply they can be
>arbitrarily named, as long as they include the .pth extension, and can
>exist anywhere in the current sys.path. Other
[EMAIL PROTECTED] wrote:
I'm unclear on how .pth files work. Some posts imply they can be
arbitrarily named, as long as they include the .pth extension, and can
exist anywhere in the current sys.path. Other documentation seems to
imply that they must be named .pth, although I'm not
On Tue, 22 Mar 2005 12:52:28 -0600, Skip Montanaro <[EMAIL PROTECTED]> wrote:
> .pth naming is just a convention so you can easily sort out the
> association for each of multiple pth files. I have a mojam.pth file but no
> "mojam" package on my server. Works just f
Ben> I'm unclear on how .pth files work. Some posts imply they can be
Ben> arbitrarily named, as long as they include the .pth extension, and
Ben> can exist anywhere in the current sys.path. Other documentation
Ben> seems to imply that they must be named .
I'm unclear on how .pth files work. Some posts imply they can be
arbitrarily named, as long as they include the .pth extension, and can
exist anywhere in the current sys.path. Other documentation seems to
imply that they must be named .pth, although I'm not sure what
"package&quo
83 matches
Mail list logo