Comments (2)
hi @rhytnen
pyz files created with shiv modify the sys.path
upon bootstrapping and place the packed dependencies before any other instances of site-packages or dist-packages. The precedence order should be as follows:
- $CWD & stdlib, since we don't package these, they are searched first during import. This is python's default behavior
- the dependencies included in your pyz
- any site packages on your local machine (so anything that may have been added via
sudo pip install
orpip install --user
) - any dist-packages, so anything that the OS maintainer includes by default
So when you say you have a version of pyyaml installed into your "core python" I presume you mean via pip install
into the global site-packages, this should be evaluated after the pyyaml that's included in your pyz. The only scenario where it would be picked up first would be if you are running the pyz in the same $CWD as a pyyaml (since Python's default import order checks in $CWD first).
What version of shiv
did you create the pyz with? Another helpful piece of debugging info would be to run SHIV_INTERPRETER=1 ./path/to/your/pyz
and then copy/paste the output of import sys; print(sys.path)
thanks!
from shiv.
BTW, it would be a nice addition security-wise if there were a flag to remove the CWD from sys.path
on bootstrap, to prevent code injection attacks.
from shiv.
Related Issues (20)
- use the python interpreter (to set the shebang line) when running pip HOT 2
- Accept pipenv's Pipfile.lock in place of pip's requirements.txt HOT 3
- Repetition of `site-packages\build\lib\build\lib\...` HOT 1
- support for packages with a .pth file HOT 3
- Run fails if the built app contains more than 65535 files or is over 2GB HOT 1
- ConfigParser issue with duplicate option entries HOT 2
- Shiv ignores files defined in .gitignore without an option to override and add anyway HOT 2
- Error while finding module specification for '__main__' HOT 2
- How to use single shiv zipapp/pyz for multiple python scripts HOT 1
- Error if output path doesn't exist HOT 1
- The shiv of release page should probably be generated on Windows HOT 1
- Any way to use shiv on read-only filesystem? HOT 2
- Is asyncio supported? HOT 1
- Environments created with symlinked folders (by PDM with cache=True) are not correctly packed
- shiv version 1.0.4 reports the incorrect version of 1.0.3
- Shiv with console script prints the __main__ module dictionary to stderr HOT 1
- Windows: Bug in Interpreter Path Handling
- Is there a way to show a message to the user during the environment bootstrapping phase? HOT 3
- Incorrect bootstrap filename HOT 3
- DuplicateOptionError when there is { in entry_points.txt file
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from shiv.