Tag Archives: Cents7

Centos7 View java-v Error [How to Solve]

[root@localhost ~]# java -v
Unrecognized option: -v
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.

jdk1. 7 view the version number through java -V and java --version,
and jdk1 8 you have to check the version number through java -version

CentOS 7: How to Solve Mysqlclient Install Error

centos7 install mysqlclient error problem
1.Install pip3 install mysqlclient error:

ERROR: Command errored out with exit status 1: command: /data/env/pyweb/bin/python3 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-noasaa4g/mysqlclient/setup.py'"'"'; file='"'"'/tmp/pip-install-noasaa4g/mysqlclient/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-install-noasaa4g/mysqlclient/pip-egg-info cwd: /tmp/pip-install-noasaa4g/mysqlclient/ Complete output (12 lines): /bin/sh: mysql_config: command not found /bin/sh: mariadb_config: command not found /bin/sh: mysql_config: command not found Traceback (most recent call last): File "<string>", line 1, in <module> File "/tmp/pip-install-noasaa4g/mysqlclient/setup.py", line 16, in <module> metadata, options = get_config() File "/tmp/pip-install-noasaa4g/mysqlclient/setup_posix.py", line 61, in get_config libs = mysql_config("libs") File "/tmp/pip-install-noasaa4g/mysqlclient/setup_posix.py", line 29, in mysql_config raise EnvironmentError("%s not found" % (_mysql_config_path,)) OSError: mysql_config not found ---------------------------------------- ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

2. Analysis and solution: Check the error message:
mysql_config not found
Make sure the problem is with the mysql_config dependency package, add a soft link
ln -s /usr/local/mysql/bin/mysql_config /usr/local/bin/mysql_config found that it still doesn’t work, need to install mysql-devel first

yum install mysql-devel

Then install mysqlclient

pip3 install mysqlclient

Solve the Chinese display garbled code under centos7

Today, I debugged the application on CentOS 7 system and found that Chinese is a pile of random codes. Then I checked the data and solved it successfully. I hereby record it.

1. Execute the locale command to view the preview environment of the current system

It can be seen that my language environment is not Chinese, but ASCII.

2. Execute locale – a | grep zh_ Cn * check whether the current system has a Chinese language pack

If the above content is displayed, the Chinese package has been installed. If not, execute Yum install kde-l10n-chinese

3. Execute VI/etc/locale.conf, as shown below

LANG=”en_ US.UTF-8″

Change “en-us.utf-8” to “zh”_ CN.UTF-8”

4. Execute source/etc/locale.conf

5. Execute locale to view the results

As shown in the above figure, the modification is successful

————————————————

References:

https://blog.csdn.net/jisu30miao1225/article/details/80519368