How to specify location of boost_python-vc90-mt-gd-1_38.dll?

View: New views
6 Messages — Rating Filter:   Alert me  

How to specify location of boost_python-vc90-mt-gd-1_38.dll?

by David Roy :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

I have no problems with compiling my boost.python pyd library.
When I try to run the python script that import the pyd library, I've got an error:

This application couldn't start because boost_python-vc90-mt-gd-1_38.dll was not found (...)

But this works fine if I drop this dll in my project directory. I suppose there is a way to avoid doing that and specify that this dll is in "C:\Program Files\boost\boost_1_38\bin.v2\libs\python\build\msvc-9.0\debug\threading-multi".

Probably through one of the jamroot, boost-build.jam, user-config.jam?
Anyone can help ? (I know this is a rookie question :-))

Thanks
-David

Re: How to specify location of boost_python-vc90-mt-gd-1_38.dll?

by Vladimir Prus :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Wednesday 08 July 2009 David Roy wrote:

>
> Hi,
>
> I have no problems with compiling my boost.python pyd library.
> When I try to run the python script that import the pyd library, I've got an
> error:
>
> This application couldn't start because boost_python-vc90-mt-gd-1_38.dll was
> not found (...)
>
> But this works fine if I drop this dll in my project directory. I suppose
> there is a way to avoid doing that and specify that this dll is in
> "C:\Program
> Files\boost\boost_1_38\bin.v2\libs\python\build\msvc-9.0\debug\threading-multi".

You'll have to add that directory to your PATH environment variable.
 
> Probably through one of the jamroot, boost-build.jam, user-config.jam?
> Anyone can help ? (I know this is a rookie question :-))

While Boost.Build can be made to automatically add to PATH (just like Boost.Python
tests do, and like tutorial does), it's is not possible to make standalone
Python module refer to Boost.Python dll by absolute path -- I don't think it's
possibe in windows at all.

- Volodya
_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost-build

Re: How to specify location of boost_python-vc90-mt-gd-1_38.dll?

by David Roy :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Many thanks Volodya, that works!

My purpose is to have this path automatically appended with no action of the user, and with portability on various OS. So I added the following lines to my script:

import os
os.environ['path'] = os.environ['path'] + os.pathsep + "C:/Program Files/boost/boost_1_38/bin.v2/libs/python/build/msvc-9.0/debug/threading-multi/"

Would you consider it the right way to do that? One advantage seems to be that PATH is "cleaned" from the appended directory at the end of execution.

Thanks
-David

Vladimir Prus wrote:
On Wednesday 08 July 2009 David Roy wrote:

>
> Hi,
>
> I have no problems with compiling my boost.python pyd library.
> When I try to run the python script that import the pyd library, I've got an
> error:
>
> This application couldn't start because boost_python-vc90-mt-gd-1_38.dll was
> not found (...)
>
> But this works fine if I drop this dll in my project directory. I suppose
> there is a way to avoid doing that and specify that this dll is in
> "C:\Program
> Files\boost\boost_1_38\bin.v2\libs\python\build\msvc-9.0\debug\threading-multi".

You'll have to add that directory to your PATH environment variable.
 
> Probably through one of the jamroot, boost-build.jam, user-config.jam?
> Anyone can help ? (I know this is a rookie question :-))

While Boost.Build can be made to automatically add to PATH (just like Boost.Python
tests do, and like tutorial does), it's is not possible to make standalone
Python module refer to Boost.Python dll by absolute path -- I don't think it's
possibe in windows at all.

- Volodya
_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost-build

Re: How to specify location of boost_python-vc90-mt-gd-1_38.dll?

by Vladimir Prus :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Thursday 09 July 2009 David Roy wrote:

>
> Many thanks Volodya, that works!
>
> My purpose is to have this path automatically appended with no action of the
> user, and with portability on various OS. So I added the following lines to
> my script:
>
> import os
> os.environ['path'] = os.environ['path'] + os.pathsep + "C:/Program
> Files/boost/boost_1_38/bin.v2/libs/python/build/msvc-9.0/debug/threading-multi/"
>
> Would you consider it the right way to do that? One advantage seems to be
> that PATH is "cleaned" from the appended directory at the end of execution.

I suspect that from inside Python, changing sys.path would be a better approach.

- Volodya
_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost-build

Re: How to specify location of boost_python-vc90-mt-gd-1_38.dll?

by David Roy :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

That was my original idea but I didn't succeed in having it work with changing sys.path.
Also from what I understand, sys.path specifies to python the list of directories where modules have to be searched. In my case I want to indicate the path to the boost_build dll, not to my python modules, maybe that's why it doesn't work.

Here's what I tried:
import sys
sys.path.append("C:/Program Files/boost/boost_1_38/bin.v2/libs/python/build/msvc-9.0/debug/threading-multi/")

If you have an idea on how I can make it work with sys.path, I'd be happy to try it.

Thanks
-David
 
Vladimir Prus wrote:
On Thursday 09 July 2009 David Roy wrote:

>
> Many thanks Volodya, that works!
>
> My purpose is to have this path automatically appended with no action of the
> user, and with portability on various OS. So I added the following lines to
> my script:
>
> import os
> os.environ['path'] = os.environ['path'] + os.pathsep + "C:/Program
> Files/boost/boost_1_38/bin.v2/libs/python/build/msvc-9.0/debug/threading-multi/"
>
> Would you consider it the right way to do that? One advantage seems to be
> that PATH is "cleaned" from the appended directory at the end of execution.

I suspect that from inside Python, changing sys.path would be a better approach.

- Volodya
_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost-build

Re: How to specify location of boost_python-vc90-mt-gd-1_38.dll?

by Vladimir Prus :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Friday 10 July 2009 David Roy wrote:

>
> That was my original idea but I didn't succeed in having it work with
> changing sys.path.
> Also from what I understand, sys.path specifies to python the list of
> directories where modules have to be searched. In my case I want to indicate
> the path to the boost_build dll, not to my python modules, maybe that's why
> it doesn't work.
>
> Here's what I tried:
> import sys
> sys.path.append("C:/Program
> Files/boost/boost_1_38/bin.v2/libs/python/build/msvc-9.0/debug/threading-multi/")
>
> If you have an idea on how I can make it work with sys.path, I'd be happy to
> try it.

This is what I would have tried myself. If it does not work, then I presume the path
tweaking you did earlier is the only solution.

HTH,
Volodya
_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost-build