Install fontcustom/fontforge in Ubuntu - python

I'm trying to install fontforge --with-python in Linux Ubuntu 14.04 LTS.
I did this hand steps listed here (https://github.com/fontforge/fontforge/blob/master/INSTALL-git.md) but it still does not working.
Does someone know if there is another way to make it works?
Thanks!

You don't need to compile FontForge, but the Python bindings must be specifically installed:
sudo add-apt-repository ppa:fontforge/fontforge
sudo apt-get update
sudo apt-get install fontforge python-fontforge

The best solution I found was:
INSTALL LINUXBREW:
https://github.com/Linuxbrew/linuxbrew
Then I did:
$brew install fontforge --with-python
$brew install eot-utils
$gem install fontcustom
And did the rest of my process till Gulp:
$npm install
$bundle install
$gulp fontcustom
$gulp
That is it! Tks!

Related

Install Python3.7 on Ubuntu Machine, dist-packages empty

I've installed Python3.7 on Ubuntu using sudo apt-get install python3.7. Python3.7 installs, but the dist-packages folder is empty and pip and other packages cannot be installed.
Is there a way to build out the dist-packages folder?
You should install pip3 through apt too!
sudo apt install python3-pip
You could try and start again following the guide given by python or see if there's anything you've missed.
https://docs.python-guide.org/starting/install3/linux/
Also I'm not sure if this will work, but try sudo apt-get install python.

ImportError: The 'enchant' C library was not found. Please install it via your OS package manager, or use a pre-built binary wheel from PyPI

The question is why I see the error message in the title when trying to import enchant. I am using Win64.
On Ubuntu, run sudo apt-get install libenchant1c2a
I found the answer in this GitHub page.
In a nutshell, they have not shipped a wheel for the win_amd64 platform yet.
Resolved: On Win7-64 I ran
pip3 install pyenchant==1.6.6
which seems to be the latest version of PyEnchant that still shipped with Win-64 binaries. Newer versions did not install for me, but this one did.
For amazon ubuntu instance use.
yum install enchant
and then
pip install pyenchant
For me, the problem I ran into was that I had an old version of pip. I installed the latest version and was able to download the pyenchant library.
pip install -U pip
On Windows x64 I've solved this problem as follows:
Click link https://pypi.org/project/pyenchant/#files and download pyenchant-2.0.0.win32.exe
Launch it and while installing it using the installation wizard you must specify your python interpreter location which in my case is:
C:\Users\Asus\AppData\Local\Programs\Python\Python36\python.exe
Important:İf you use python32 interpreter you must specify this location:
C:\Users\Asus\AppData\Local\Programs\Python\Python36-32\python.exe
if you use python 3.5 interpreter version your location may be like this:
C:\Users\Asus\AppData\Local\Programs\Python\Python35\python.exe
and finish the installation. Pip commands will work now for other dependency packages.
On MacOS, you can install it via brew:
brew install enchant
pip install pyenchant
To run with docker on AWS:
With apt-get:
sudo apt-get update
sudo apt-get -y install enchant-2
With apt:
sudo apt update
sudo apt -y install enchant-2
Thank you
I have fix the bugs on the colab.
!apt update
!apt install enchant --fix-missing
After fixing the missing files, you could run the enchant.

psycopg: Python.h: No such file or directory

I'm compiling psycopg2 and get the following error:
Python.h: No such file or directory
How to compile it, Ubuntu12 x64.
Python 2:
sudo apt-get install python-dev
Python 3:
sudo apt-get install python3-dev
This is a dependency issue.
I resolved this issue on Ubuntu using apt-get. Substitute it with a package manager appropriate to your system.
For any current Python version:
sudo apt-get install python-dev
For alternative Python version:
sudo apt-get install python<version>-dev
For example 3.5 as alternative:
sudo apt-get install python3.5-dev
if you take a look at PostgreSQL's faq page ( http://initd.org/psycopg/docs/faq.html ) you'll see that they recommend installing pythons development package, which is usually called python-dev. You can install via
sudo apt-get install python-dev
As mentioned in psycopg documentation http://initd.org/psycopg/docs/install.html
Psycopg is a C wrapper around the libpq PostgreSQL client library. To install it from sources you will need:
C compiler
Python header files
They are usually installed in a package such as python-dev a message error such: Python.h: no such file or directory indicate that you missed mentioned python headers.
How you can fix it? First of all you need check which python version installed in your virtual envitonment or in system itself if you didnt use virtual environment. You can check your python version by:
python --version
After it you should install the same python-dev version which installed on your virtual env or system. For example if you use python3.7 you should install
apt-get install python3.7-dev
Hope my answer will help anyone
Based on the python version your your pipenv file requires, you need to install the corresponding dev file.
I was getting this error and my default python version was 3.8 but the pipenv file was requiring the Python3.9 version. So I installed the python3.9 dev.
$ sudo apt install python3.9-dev
While all answers here are correct, they won't work correctly anyway:
- sudo apt-get install python3-dev
- sudo apt-get install python3.5-dev
- etc ..
won't apply when you are using python3.8, python3.9 or future versions
I recommend using a deterministic way instead :
sudo apt install python3-all-dev
On Fedora, Redhat or centos
Python 2:
sudo yum install python-devel
Python 3:
sudo yum install python3-devel
if none of the above-suggested answers is not working, try this it's worked for me.
sudo apt-get install libpq-dev

How to get libicui18n.so.36 ?

I try to install PyICU but it require libicui18n.so.36
I dont know How to get it could you help me please...
If you are on Ubuntu, try installing the python-pyicu package, which should take care of any binary dependencies, instead of trying to install from the sources:
$ sudo apt-get install python-pyicu
Alternatively, if you really need to install from the source package (e.g. with pip install pyicu), you'll need to the libicu development package installed:
$ sudo apt-get install libicu-dev

ImportError: No module named psycopg2

In installation process of OpenERP 6, I want to generate a config file with these commands:
cd /home/openerp/openerp-server/bin/
./openerp-server.py -s --stop-after-init -c /home/openerp/openerp-server.cfg
But it always showed the message: ImportError: No module named psycopg2
When I checked for psycopg2 package, it's already installed. Package python-psycopg2-2.4.5-1.rhel5.x86_64 is already installed to its latest version. Nothing to do. What's wrong with this? My server is CentOS, I've installed Python 2.6.7.
Step 1: Install the dependencies
sudo apt-get install build-dep python-psycopg2
Step 2: Run this command in your virtualenv
pip install psycopg2-binary
Ref: Fernando Munoz
Use psycopg2-binary instead of psycopg2.
pip install psycopg2-binary
Or you will get the warning below:
UserWarning: The psycopg2 wheel package will be renamed from release 2.8; in order to keep installing from binary please use "pip install psycopg2-binary" instead. For details see: http://initd.org/psycopg/docs/install.html#binary-install-from-pypi.
Reference: Psycopg 2.7.4 released | Psycopg
I faced the same issue and resolved it with following commands:
sudo apt-get install libpq-dev
pip install psycopg2
Try installing
psycopg2-binary
with
pip install psycopg2-binary --user
Please try to run the command import psycopg2 on the python console. If you get the error then check the sys.path where the python look for the install module. If the parent directory of the python-psycopg2-2.4.5-1.rhel5.x86_64 is there in the sys.path or not. If its not in the sys.path then run export PYTHONPATH=<parent directory of python-psycopg2-2.4.5-1.rhel5.x86_64> before running the openerp server.
Import Error on Mac OS
If psycopg2 is getting installed but you are unable to import it in your .py file then the problem is libpq, its linkages, and the library openssl, on which libpq depends upon. The overall steps are reproduced below. You can check it step by step to know which is the source of error for you and then you can troubleshoot from there.
Check for the installation of the openssl and make sure it's working.
Check for installation of libpq in your system it may not have been installed or not linked. If not installed then install it using the command brew install libpq. This installs libpq library. As per the documentation
libpq is the C application programmer's interface to PostgreSQL. libpq is a set of library functions that allow client programs to pass queries to the PostgreSQL backend server and to receive the results of these queries.
Link libpq using brew link libpq, if this doesn't work then use the command: brew link libpq --force.
Also put in your .zshrc file the following export PATH="/usr/local/opt/libpq/bin:$PATH". This creates all the necessary linkages for libpq library .
Now restart the terminal or use the following command source ~/.zshrc.
Now use the command pip install psycopg2. It will work.
This works, even when you are working in conda environment.
N.B. pip install psycopg2-binaryshould be avoided because as per the developers of the psycopg2 library
The use of the -binary packages in production is discouraged because in the past they proved unreliable in multithread environments. This might have been fixed in more recent versions but I have never managed to reproduce the failure.
Try with these:
virtualenv -p /usr/bin/python3 test_env
source test_env/bin/activate
pip install psycopg2
run python and try to import if you insist on installing it on your systems python try:
pip3 install psycopg2
Recently faced this issue on my production server. I had installed pyscopg2 using
sudo pip install psycopg2
It worked beautifully on my local, but had me for a run on my ec2 server.
sudo python -m pip install psycopg2
The above command worked for me there. Posting here just in case it would help someone in future.
sudo pip install psycopg2-binary
You need to install the psycopg2 module.
On CentOS:
Make sure Python 2.7+ is installed. If not, follow these instructions: http://toomuchdata.com/2014/02/16/how-to-install-python-on-centos/
# Python 2.7.6:
$ wget http://python.org/ftp/python/2.7.6/Python-2.7.6.tar.xz
$ tar xf Python-2.7.6.tar.xz
$ cd Python-2.7.6
$ ./configure --prefix=/usr/local --enable-unicode=ucs4 --enable-shared LDFLAGS="-Wl,-rpath /usr/local/lib"
$ make && make altinstall
$ yum install postgresql-libs
# First get the setup script for Setuptools:
$ wget https://bitbucket.org/pypa/setuptools/raw/bootstrap/ez_setup.py
# Then install it for Python 2.7 and/or Python 3.3:
$ python2.7 ez_setup.py
$ easy_install-2.7 psycopg2
Even though this is a CentOS question, here are the instructions for Ubuntu:
$ sudo apt-get install python3-pip python-distribute python-dev
$ easy_install psycopg2
Cite: http://initd.org/psycopg/install/
For python3 on ubuntu, this worked for me:
$sudo apt-get update
$sudo apt-get install libpq-dev
$sudo pip3 install psycopg2-binary
i have the same problem, but this piece of snippet alone solved my problem.
pip install psycopg2
Run into the same issue when I switch to Ubuntu from Windows 10.. the following worked for me.. this after googling and trying numerous suggestions for 2 hours...
sudo apt-get install libpq-dev
then
pip3 install psycopg2
I hope this helps someone who has encountered the same problem especially when switching for windows OS to Linux(Ubuntu).
I have done 2 things to solve this issue:
use Python 3.6 instead of 3.8.
change Django version to 2.2 (may be working with some higher but I change to 2.2)
For Python3
Step 1: Install Dependencies
sudo apt-get install python3 python-dev python3-dev
Step 2: Install
pip install psycopg2
check correctly if you had ON your virtual env of your peoject, if it's OFF then make it ON. execute following cammands:
workon <your_env_name>
python manage.py runserver
It's working for me
It's very simple, not sure why nobody mentioned this for mac before.
brew install postgresql
pip3 install psycopg2
In simple terms, psycopg2 wants us to install postgres first.
PS: Don't forget to upvote, so that it can help other people as well.
Solved the issue with below solution :
Basically the issue due to _bz2.cpython-36m-x86_64-linux-gnu.so Linux package file. Try to find the the location.
Check the install python location ( which python3)- Example: /usr/local/bin/python3
copy the file under INSTALL_LOCATION/lib/python3.6
cp -rvp /usr/lib64/python3.6/lib-dynload/_bz2.cpython-36m-x86_64-linux-gnu.so /usr/local/lib/python3.6
try:
pip install psycopg2 --force-reinstall --no-cache-dir
Python2 importerror no module named psycopg2
pip install psycopg2-binary
Requirement already satisfied...
Solved by following steps:
sudo curl https://bootstrap.pypa.io/pip/2.7/get-pip.py -o get-pip.py
sudo python get-pip.py
sudo python -m pip install psycopg2-binary
pip install psycopg-binary
The line above helped me
For Python3 use this:
sudo apt-get install -y python3-psycopg2

Categories

Resources