Python package locations
Wei Huang
Posts: 98
I think this isn't a font technology specific problem but I think people here have definitely had this issue before.
I installed fontTools with pip and it's located in
/usr/local/lib/python2.7/site-packages
It seems Fontlab and Glyphs App both expect it to be in
/Library/Python/2.7/site-packages/
What's the correct way to fix this? Can one add some kind of link to /Library/Python/2.7/site-packages/ telling both apps that it's in the former location? Or should it be installed in /Library/Python/2.7/site-packages/ anyway (how?)
I installed fontTools with pip and it's located in
/usr/local/lib/python2.7/site-packages
It seems Fontlab and Glyphs App both expect it to be in
/Library/Python/2.7/site-packages/
What's the correct way to fix this? Can one add some kind of link to /Library/Python/2.7/site-packages/ telling both apps that it's in the former location? Or should it be installed in /Library/Python/2.7/site-packages/ anyway (how?)
Tagged:
0
Comments
-
Can’t you just use a .pth file as a redirect?It’s been a while since I did this, so someone else will correct me if I’m wrong. Create a text file and name it “fontTools.pth”. The contents will be simply the path to your installation, just as you have it above (but with a trailing “/”). Place this .pth file in the directory where Fontlab and Glyphs are looking for fontTools.See if that works.
1 -
Glyphs doesn’t expect a specific location. It relies on the sys.path of the system python to include the path where the module is installed.0
-
You can specify pip package install locations with -t, but I don't think this is what you are after. If you are using a different pip than your system python/pip it will likely cause other issues down the road, even if you can point to the right site-packages.Make sure any other than the system pre-installed python/pip are run as separate binaries (e.g. brew python installs them as python2 or python3 to avoid collisions) and only install fonttools with pip once you are positive it’s the system pre-installed version and target directory for package installs.If you ever need to pip install anything for a specific project it’s a good idea to use either virtualenv or better yet pyenv to manage separate python environments for each project. For programs that look for packages in default locations you can then use the system pip to install packages, as an exception to the rule, so to say.
0 -
Thanks for the advice, I ended up symlinking it into the folder,
@Georg Seifert I see.. the former folder is definitely in the sys.path.0
Categories
- All Categories
- 43 Introductions
- 3.7K Typeface Design
- 803 Font Technology
- 1K Technique and Theory
- 622 Type Business
- 444 Type Design Critiques
- 542 Type Design Software
- 30 Punchcutting
- 136 Lettering and Calligraphy
- 83 Technique and Theory
- 53 Lettering Critiques
- 485 Typography
- 303 History of Typography
- 114 Education
- 68 Resources
- 499 Announcements
- 80 Events
- 105 Job Postings
- 148 Type Releases
- 165 Miscellaneous News
- 270 About TypeDrawers
- 53 TypeDrawers Announcements
- 116 Suggestions and Bug Reports