poemdistance / google-translate Goto Github PK
View Code? Open in Web Editor NEWPython 谷歌中英文翻译
License: MIT License
Python 谷歌中英文翻译
License: MIT License
说明:我的环境里已卸载默认的unity桌面,换成了 gnome 桌面。
安装依赖
sudo apt install libx11-dev xorg-dev xdotools build-essential gnome-devel libxtst-dev
如果有提示某个包已被设置为手动安装,可以用 sudo apt-mark auto <package> 来标记回自动安装
拉取代码
git clone --depth=1 <本仓库git地址>
安装 pip3 工具
sudo apt install python3-pip
安装 python 模块
pip3 install sysv_ipc pytesseract termcolor readline requests
> 不知道需不需要 sys re json warnings urllib os time socket pillow ast pickle math...
测试
tranen "Chinese"
另外安装过程中报错了:package init file 'translate/package/__init__.py' not found (or not a regular file)
详细日志:
$ sudo ./setup.py install
running install
Running custom command:
Change and cp src file to: /home/yu/0repo/Stranslater/google-translate/translate/package/tranen.py
Change and cp src file to: /home/yu/0repo/Stranslater/google-translate/translate/package/tranpic.py
Just cp file to /home/yu/0repo/Stranslater/google-translate/translate/package/getTK.py
Change and cp src file to: /home/yu/0repo/Stranslater/google-translate/translate/package/tranzh.py
Change and cp src file to: /home/yu/0repo/Stranslater/google-translate/translate/package/Translator.py
Coping execution file to /usr/bin
'translate/package/tranen.py' -> '/usr/bin/tranen'
'translate/package/tranzh.py' -> '/usr/bin/tranzh'
'translate/package/tranpic.py' -> '/usr/bin/tranpic'
running build
running build_py
package init file 'translate/package/__init__.py' not found (or not a regular file)
creating build
creating build/lib
creating build/lib/translate
creating build/lib/translate/package
copying translate/package/tranen.py -> build/lib/translate/package
copying translate/package/createPackage.py -> build/lib/translate/package
copying translate/package/tranpic.py -> build/lib/translate/package
copying translate/package/getTK.py -> build/lib/translate/package
copying translate/package/tranzh.py -> build/lib/translate/package
copying translate/package/Translator.py -> build/lib/translate/package
running install_lib
creating /usr/local/lib/python3.5/dist-packages/translate
creating /usr/local/lib/python3.5/dist-packages/translate/package
copying build/lib/translate/package/tranen.py -> /usr/local/lib/python3.5/dist-packages/translate/package
copying build/lib/translate/package/createPackage.py -> /usr/local/lib/python3.5/dist-packages/translate/package
copying build/lib/translate/package/tranpic.py -> /usr/local/lib/python3.5/dist-packages/translate/package
copying build/lib/translate/package/getTK.py -> /usr/local/lib/python3.5/dist-packages/translate/package
copying build/lib/translate/package/tranzh.py -> /usr/local/lib/python3.5/dist-packages/translate/package
copying build/lib/translate/package/Translator.py -> /usr/local/lib/python3.5/dist-packages/translate/package
byte-compiling /usr/local/lib/python3.5/dist-packages/translate/package/tranen.py to tranen.cpython-35.pyc
byte-compiling /usr/local/lib/python3.5/dist-packages/translate/package/createPackage.py to createPackage.cpython-35.pyc
byte-compiling /usr/local/lib/python3.5/dist-packages/translate/package/tranpic.py to tranpic.cpython-35.pyc
byte-compiling /usr/local/lib/python3.5/dist-packages/translate/package/getTK.py to getTK.cpython-35.pyc
byte-compiling /usr/local/lib/python3.5/dist-packages/translate/package/tranzh.py to tranzh.cpython-35.pyc
byte-compiling /usr/local/lib/python3.5/dist-packages/translate/package/Translator.py to Translator.cpython-35.pyc
running install_egg_info
running egg_info
creating Google_translate.egg-info
writing top-level names to Google_translate.egg-info/top_level.txt
writing Google_translate.egg-info/PKG-INFO
writing dependency_links to Google_translate.egg-info/dependency_links.txt
writing manifest file 'Google_translate.egg-info/SOURCES.txt'
reading manifest file 'Google_translate.egg-info/SOURCES.txt'
writing manifest file 'Google_translate.egg-info/SOURCES.txt'
Copying Google_translate.egg-info to /usr/local/lib/python3.5/dist-packages/Google_translate-1.0.egg-info
running install_scripts
安装PySocks pip3 install PySocks
就可以用socks代理了
google-translate/tests/packageTest.py
Lines 3 to 5 in 1afc622
proxy = { 'https':'socks5://127.0.0.1:2334' }
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.