I'm having problem importing gi
module in python3.6. When importing it using python3.5 it works fine but when using python3.6 I get:
ImportError: cannot import name '_gi'
How can I fix this?
I also faced this issue while trying to import gi from miniconda python3.7 and fixed it by doing the following:
First, create a symlink to gi module in your system python. For me, the command is as follows:
ln -s /usr/lib/python3/dist-packages/gi/ /home/$USER/miniconda3/lib/python3.7/site-packages/
Then, open the directory
cd /home/$USER/miniconda3/lib/python3.7/site-packages/gi/
and run the following commands:
sudo cp _gi.cpython-35m-x86_64-linux-gnu.so _gi.cpython-37m-x86_64-linux-gnu.so
sudo cp _gi_cairo.cpython-35m-x86_64-linux-gnu.so _gi_cairo.cpython-37m-x86_64-linux-gnu.so
My system python is python3.5 and miniconda python is python3.7. Your version is 3.6, so take care of that in the commands above (-35m- and -37m-).
Method obtained from this link https://askubuntu.com/questions/1057832/how-to-install-gi-for-anaconda-python3-6
Hope this helps.
Best,
Aneesh
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With