jiansoung / issues-list Goto Github PK
View Code? Open in Web Editor NEW记录日常学习和开发遇到的问题。欢迎评论交流:)
Home Page: https://github.com/jiansoung/issues-list/issues
License: MIT License
记录日常学习和开发遇到的问题。欢迎评论交流:)
Home Page: https://github.com/jiansoung/issues-list/issues
License: MIT License
今天把系统更新至 macOS Sonoma 后,使用 Xcode 编译运行项目的时候总会弹出如下的警告窗口:
只要修改项目代码再编译运行,就一定会再次弹出这样的窗口。这很令人烦恼!
Google 了下,发现了一篇文章《macOS Sonoma sandbox security》解释了出现这种情况的原因。
根据我对这篇文章的理解,我发现只要在 TARGETS > Signing & Capabilities 里给项目设置好 Team 和 Signing Certificate 就能解决这个的问题。
重要的是,你的 Apple ID 并不需要 Enroll Apple Developer Program 才可以解决这个问题。也就说你无需注册缴费成为 Apple 开发者,只要你有 Apple ID 即可。
当然,如果你是缴过费的正式 Apple 开发者,那么选择你对应的 Signing & Capabilities 选项也是可以的。
PS:正式开发者的选项具体是什么我也不知道,毕竟我还没有注册缴费成为 Apple 开发者😂
如果你也遇到这样的问题,那就赶紧试一试 !😁
have fun :-)
You can create a global .gitignore file, which is a list of rules for ignoring files in every Git repository on your computer. For example, you might create the file at ~/.gitignore_global and add some rules to it.
Open Terminal.
Run the following command in your terminal:
git config --global core.excludesFile ~/.gitignore_global
$ brew doctor
Please note that these warnings are just used to help the Homebrew maintainers
with debugging if you file an issue. If everything you use Homebrew for is
working fine: please don't worry or file an issue; just ignore this. Thanks!
Warning: "config" scripts exist outside your system or Homebrew directories.
`./configure` scripts often look for *-config scripts to determine if
software packages are installed, and what additional flags to use when
compiling and linking.
Having additional scripts in your path can confuse software installed via
Homebrew if the config script overrides a system or Homebrew provided
script of the same name. We found the following "config" scripts:
/Users/songjian/.pyenv/shims/python3.6m-config
/Users/songjian/.pyenv/shims/python-config
/Users/songjian/.pyenv/shims/python3-config
/Users/songjian/.pyenv/shims/python3.6-config
Put the following line into your shell profile (~/.bash_profile
or ~/.zshrc
)
alias brew="env PATH=${PATH/\/Users\/${USER}\/\.pyenv\/shims:/} brew"
Could not fetch URL https://pypi.python.org/simple/scrapy/: There was a problem confirming the ssl certificate: [SSL: TLSV1_ALERT_PROTOCOL_VERSION] tlsv1 alert protocol version (_ssl.c:645) - skipping
Could not find a version that satisfies the requirement Scrapy
No matching distribution found for Scrapy
Upgrade pip using:
curl https://bootstrap.pypa.io/get-pip.py | python3
Notes on The Hitchhiker’s Guide to Python
pyenv
is a tool to allow multiple versions of the Python interpreter to be installed at the same time.
pyenv
works by filling a shims
directory with fake versions of the Python interpreter (plus other tools like pip and 2to3). When the system looks for a program named python
, it looks inside the shims
directory first, and uses the fake version, which in turn passes the command on to pyenv
. pyenv
then works out which version of Python should be run based on environment variables, .python-version
files, and the global default.
In order to make sure that you install packages to your active virtual environment when you use pip install
, consider adding the following lines to your ~/.bashrc
(or ~/.zshrc
) file:
export PIP_REQUIRE_VIRTUALENV=true
gpip() {
PIP_REQUIRE_VIRTUALENV="" pip "$@"
}
After saving this change and sourcing the ~/.bashrc
file (or ~/.zshrc
) with source ~/.bashrc
(or source ~/.zshrc
), pip
will no longer let you install packages if you are not in a virtual environment. (But you can use gpip
install packages globally. )
You can also do this configuration by editing your pip.conf
or pip.ini
file.
Scrapy 是用来爬取网站并抽取结构化数据的应用框架,它对所有请求的调度和处理都是异步的。
作为一款优秀的爬虫框架,Scrapy
提供了一些基本特性:
download delay
)甚至可以使用 AutoThrottle 扩展 来自动调节这些设置。
除了基本特性,Scrapy
还提供了很多强大的特性使得爬取更加简单有效。
CSS 选择器
和 XPath 表达式
scrapy shell
)signals
和预定义API( middlewares
, extensions
, pipelines
) 插入自定义功能middlewares
和 extensions
来处理:
introspect
) 和调试爬虫进程的 Telnet ConsoleSitemaps
和 XML/CSV feeds
爬虫、自动下载图片或其他媒体资源的 media pipeline
、caching DNS resolver
等等推荐在虚拟环境中安装 Scrapy
,这样可以避免可能的包冲突。以 Python 3
为例:
# 安装 scrapy
python3 -m venv .venv
source .venv/bin/activate
pip install --upgrade pip setuptools
pip install ipython scrapy
# 测试 scrapy 是否已经正确安装
scrapy bench
注:如果在 Debian
上安装,需要按如下方式确保依赖完整:
sudo apt-get install python3-venv python3-dev
如果 Scrapy
无法在 Python 3.7
上正常工作,请参考: scrapy/scrapy#3143
Scrapy
是一款集调度、请求、抽取&处理、编码解码、存储、调试&监控( Telnet Console
) 等特性于一体的应用框架。
OP: https://stackoverflow.com/questions/5725296/difference-between-sh-and-bash
sh
is a specification, not an implementation.
bash
started as an sh-compatible implementation.
For my own scripts, I prefer sh for the following reasons:
$ scrapy startproject tutorial
$ tree
tutorial
├── scrapy.cfg
└── tutorial
├── __init__.py
├── __pycache__
├── items.py
├── middlewares.py
├── pipelines.py
├── settings.py
└── spiders
├── __init__.py
└── __pycache__
4 directories, 7 files
Spiders must subclass scrapy.Spider
and define the initial requests to make, optionally how to follow links in the pages, and how to parse the downloaded page content to extract data.
Create a new spider tutorial/spiders/quotes_spider.py
:
import scrapy
# Scrapy spiders must subclass `scrapy.Spider`
class QuotesSpider(scrapy.Spider):
# `name`: identifies the Spider, and must be unique within a project.
name = "quotes"
# `start_requests`: must return an iterable of Requests (list or generator)
# which the Spider will begin to crawl from. Subsequent requests will be
# generated successively from these initial requests.
def start_requests(self):
urls = [
'http://quotes.toscrape.com/page/1/',
'http://quotes.toscrape.com/page/2/',
]
for url in urls:
yield scrapy.Request(url=url, callback=self.parse)
# A shortcut to the start_requests method
# start_urls = [
# 'http://quotes.toscrape.com/page/1/',
# 'http://quotes.toscrape.com/page/2/',
# ]
# `parse`: a method that will be called to handle the response downloaded
# for each of the requests made.
# The `response` parameter is an instance of `TextResponse` that holds the
# page content and has further helpful methods to handle it.
# The parse() method usually parses the response, extracting the scraped
# data as dicts and also finding new URLs to follow and creating new
# requests (Request) from them.
def parse(self, response):
for quote in response.css('div.quote'):
yield {
'text': quote.css('span.text::text').extract_first(),
'author': quote.css('small.author::text').extract_first(),
'tags': quote.css('div.tags a.tag::text').extract(),
}
next_page = response.css('li.next a::attr(href)').extract_first()
if next_page is not None:
next_page = response.urljoin(next_page)
# What you see here is Scrapy’s mechanism of following links: when
# you yield a Request in a callback method, Scrapy will schedule
# that request to be sent and register a callback method to be
# executed when that request finishes.
yield scrapy.Request(next_page, callback=self.parse)
# A shortcut for creating Requests
# next_page = response.css('li.next a::attr(href)').extract_first()
# if next_page is not None:
# yield response.follow(next_page, callback=self.parse)
# Or follow all link
# for a in response.css('li.next a'):
# yield response.follow(a, callback=self.parse)
$ scrapy crawl quotes -o quotes.json
$ scrapy shell 'http://quotes.toscrape.com/page/1/'
mysqldump -u {user} -p {database} > /home/$USER/Documents/backup.sql
sudo service mysql stop
sudo apt-get --purge remove "mysql*"
sudo rm -rf /etc/mysql/
sudo apt-get autoremove
sudo apt-get autoclean
sudo updatedb
locate mysql
Given a version number MAJOR.MINOR.PATCH
, increment the:
MAJOR
version when you make incompatible API changes,MINOR
version when you add functionality in a backwards-compatible manner, andPATCH
version when you make backwards-compatible bug fixes.Additional labels for pre-release and build metadata are available as extensions to the MAJOR.MINOR.PATCH
format.
A version specifier consists of a series of version clauses, separated by commas. For example:
~= 0.9, >= 1.0, != 1.3.4.*, < 2.0
The comparison operator determines the kind of version clause:
Open termial & change directory to your repository.
Replacing the following variables based on the information you gathered:
OLD_EMAIL
CORRECT_NAME
CORRECT_EMAIL
git filter-branch --env-filter '
OLD_EMAIL="[email protected]"
CORRECT_NAME="Your Correct Name"
CORRECT_EMAIL="[email protected]"
if [ "$GIT_COMMITTER_EMAIL" = "$OLD_EMAIL" ]
then
export GIT_COMMITTER_NAME="$CORRECT_NAME"
export GIT_COMMITTER_EMAIL="$CORRECT_EMAIL"
fi
if [ "$GIT_AUTHOR_EMAIL" = "$OLD_EMAIL" ]
then
export GIT_AUTHOR_NAME="$CORRECT_NAME"
export GIT_AUTHOR_EMAIL="$CORRECT_EMAIL"
fi
' --tag-name-filter cat -- --branches --tags
Copy & Paste the above command to your terminal, and press Enter to run it.
If the repository has a remote repository, push the corrected history to remote repository.
git push --force --tags origin 'refs/heads/*'
macOS + Homebrew + Pyenv
$ pyenv install 3.6.6
python-build: use openssl from homebrew
python-build: use readline from homebrew
Installing Python-3.6.6...
python-build: use readline from homebrew
BUILD FAILED (OS X 10.14 using python-build 20180424)
Inspect or clean up the working tree at /var/folders/9s/4dz5cwfj0dv6j_1_k8nlnd5m0000gn/T/python-build.20181028140503.9082
Results logged to /var/folders/9s/4dz5cwfj0dv6j_1_k8nlnd5m0000gn/T/python-build.20181028140503.9082.log
Last 10 log lines:
File "/private/var/folders/9s/4dz5cwfj0dv6j_1_k8nlnd5m0000gn/T/python-build.20181028140503.9082/Python-3.6.6/Lib/ensurepip/__main__.py", line 5, in <module>
sys.exit(ensurepip._main())
File "/private/var/folders/9s/4dz5cwfj0dv6j_1_k8nlnd5m0000gn/T/python-build.20181028140503.9082/Python-3.6.6/Lib/ensurepip/__init__.py", line 204, in _main
default_pip=args.default_pip,
File "/private/var/folders/9s/4dz5cwfj0dv6j_1_k8nlnd5m0000gn/T/python-build.20181028140503.9082/Python-3.6.6/Lib/ensurepip/__init__.py", line 117, in _bootstrap
return _run_pip(args + [p[0] for p in _PROJECTS], additional_paths)
File "/private/var/folders/9s/4dz5cwfj0dv6j_1_k8nlnd5m0000gn/T/python-build.20181028140503.9082/Python-3.6.6/Lib/ensurepip/__init__.py", line 27, in _run_pip
import pip._internal
zipimport.ZipImportError: can't decompress data; zlib not available
make: *** [install] Error 1
brew install zlib
~/.zshrc
(if you use zsh)the following content partly from the output of
brew install zlib
DO NOT FORGET TO ADD ${LDFLAGS}
, ${CPPFLAGS}
, ${PKG_CONFIG_PATH}
!
# For compilers to find zlib you may need to set:
export LDFLAGS="${LDFLAGS} -L/usr/local/opt/zlib/lib"
export CPPFLAGS="${CPPFLAGS} -I/usr/local/opt/zlib/include"
# For pkg-config to find zlib you may need to set:
export PKG_CONFIG_PATH="${PKG_CONFIG_PATH} /usr/local/opt/zlib/lib/pkgconfig"
Never use utf8
in MySQL(MySQL, MariaDB, PerconaDB, etc.)! (use utf8mb4
)
/etc/mysql/my.cnf
[client]
default-character-set=utf8mb4
[mysql]
default-character-set=utf8mb4
[mysqld]
character-set-server = utf8mb4
collation-server = utf8mb4_general_ci
skip-character-set-client-handshake
service mysql restart
MariaDB [(none)]> show variables like 'char%'; show variables like 'collation%';
+--------------------------+----------------------------+
| Variable_name | Value |
+--------------------------+----------------------------+
| character_set_client | utf8mb4 |
| character_set_connection | utf8mb4 |
| character_set_database | utf8mb4 |
| character_set_filesystem | binary |
| character_set_results | utf8mb4 |
| character_set_server | utf8mb4 |
| character_set_system | utf8 |
| character_sets_dir | /usr/share/mysql/charsets/ |
+--------------------------+----------------------------+
8 rows in set (0.01 sec)
+----------------------+--------------------+
| Variable_name | Value |
+----------------------+--------------------+
| collation_connection | utf8mb4_general_ci |
| collation_database | utf8mb4_general_ci |
| collation_server | utf8mb4_general_ci |
+----------------------+--------------------+
3 rows in set (0.00 sec)
The prerequisites of the special target .PHONY
are considered to be phony targets. When it is time to consider such a target, make will run its recipe unconditionally, regardless of whether a file with that name exists or what its last-modification time is.
A phony target is one that is not really the name of a file; rather it is just a name for a recipe to be executed when you make an explicit request.
There are two reasons to use a phony target: to avoid a conflict with a file of the same name, and to improve performance.
If you write a rule whose recipe will not create the target file, the recipe will be executed every time the target comes up for remaking. Here is an example:
clean:
rm *.o temp
Because the rm
command does not create a file named clean
, probably no such file will ever exist. Therefore, the rm
command will be executed every time you say make clean
.
In this example, the clean
target will not work properly if a file named clean
is ever created in this directory. Since it has no prerequisites, clean
would always be considered up to date and its recipe would not be executed. To avoid this problem you can explicitly declare the target to be phony by making it a prerequisite of the special target .PHONY
as follows:
.PHONY: clean
clean:
rm *.o temp
Once this is done, make clean
will run the recipe regardless of whether there is a file named clean
.
如下图所示,当执行 git push 推送本地代码至远程仓库时,提示输入账号密码,但按提示输入正确的账号密码后却报错。
这里面存在两个问题:一是我的 SSH Key 有正确设置,为什么 git 提示输入账号密码而不使用 SSH Key?二是为什么按照提示输入了正确的账号密码后会报错?
对这个问题,我首先检查了 SSH Key 是否有正常设置。如下图,SSH Key 测试通过,也就是说设置是没问题的。
$ ssh -T [email protected]
那为什么 git 不使用 SSH Key,而提示输入账号密码呢? GitHub 文档(Why is Git always asking for my password?)给出了解释:
If Git prompts you for a username and password every time you try to interact with GitHub, you're probably using the HTTPS clone URL for your repository.
检查 remote URL 发现确实如文档所述当初 clone 使用的是 HTTPS clone URL:
$ git config --get remote.origin.url
至此,第一个问题算是解决了。
总结就是当初 clone 的时候使用的是 HTTPS 的 remote URL,后来 push 也就默认使用了 HTTPS 的方式,和 SSH Key 是否正常设置无关。
原因很简单,GitHub 从2021年8月13日 09:00 PST 开始就不接受使用账户密码对 GitHub.com 进行 git 操作了。
ps:脱离业界太久。。。
As previously announced, starting on August 13, 2021, at 09:00 PST, we will no longer accept account passwords when authenticating Git operations on GitHub.com. Instead, token-based authentication (for example, personal access, OAuth, SSH Key, or GitHub App installation token) will be required for all authenticated Git operations.
链接在这里:Git password authentication is shutting down
问题既然都已明白了,现在就来解决我的需求 —— 使用 SSH Key 进行 git 操作。
操作很简单,只有两步:
一是设置 SSH Key ,参考GitHub 官方文档 Connecting to GitHub with SSH 。
二是更改仓库的 remote URL (使用 SSH 方式的 remote URL)。
$ git remote set-url origin [your SSH remote URL]
ps: 再次使用 git config --get remote.origin.url
命令可确认已经正确更改。
以后 git clone 只使用 SSH remote URL 。
Pretty Good Privacy is proprietary software and was originally written by Phil Zimmerman in 1991.
OpenPGP is a protocol. (RFC 4880)
GNU Privacy Guard, also known as GnuPG and GPG, is the Free Software Foundation’s implementation (licensed under GNU Public Licence v3) of the OpenPGP protocol, written almost entirely by Werner Koch.
“GPG Key” is a key that specific to GnuPG.
“OpenPGP Key” is the right common name.
A matching is a subset of edges in which no node occurs more than once. The weight of a matching is the sum of the weights of its edges. A maximal matching cannot add more edges and still be a matching.
Graph G: strings as nodes, and similarity of two strings as their edge's weight.
The maximum-weighted matching in the Graph G is the best result of similarity strings pairs between two datasets.
# Assume you are activating Python 3 venv
$ brew install mariadb pkg-config mysql-client
# For pkg-config to find mysql-client you may need to set PKG_CONFIG_PATH.
# This path can be found when you brew install mysql-client, replace below with yours.
$ export PKG_CONFIG_PATH="/usr/local/opt/mysql-client/lib/pkgconfig"
$ pip install mysqlclient
To keep the hostname between reboots, run
scutil --set HostName name-of-host
Check the version here: Download MySQL APT Repository
wget http://repo.mysql.com/mysql-apt-config_0.8.10-1_all.deb
sudo dpkg -i mysql-apt-config_0.8.10-1_all.deb
sudo apt update
sudo apt install mysql-server
If you see following errors:
dpkg: error processing package mysql-community-server (--configure):
subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of mysql-server:
mysql-server depends on mysql-community-server (= 8.0.13-1debian9); however:
Package mysql-community-server is not configured yet.
dpkg: error processing package mysql-server (--configure):
dependency problems - leaving unconfigured
Processing triggers for libc-bin (2.24-11+deb9u3) ...
Errors were encountered while processing:
mysql-community-server
mysql-server
Fix
sudo apt-get install -f
sudo systemctl start mysql
sudo systemctl status mysql
sudo mysql_secure_installation
Python Development Workflow with Pyenv + Pipenv
pyenv
and some python version (I use 3.6.6)Install Python with
pyenv
instead of Hombrew (if you use macOS).
NOTE: Do all the following commands in your own project directory.
Set the shell-specific Python version:
$ pyenv shell 3.6.6
Why downgrade pip to 18.0 ?
This is a bug in pipenv caused by using it alongside the newest version of pip (18.1): pypa/pipenv#2924. You need to downgrade pip — both inside and outside the pipenv environment — to version 18.0 in order for pipenv to work.
ONLY EXECUTE FOLLOWING COMMANDS AT THE CREATION OF YOUR PROJECT
$ pip install --upgrade pip==18.0 # 1
$ pip install pipenv # 2
$ pipenv install --python 3.6 # 3
$ pipenv run pip install --upgrade pip==18.0 # 4
Install packages and use the installed packages
$ pipenv install <package>
Now that package is installed, you can use it in your python script. And then you can run your python script using pipenv run
:
$ pipenv run python <your script>
Using $ pipenv run
ensures that your installed packages are available to your script.
It’s also possible to spawn a new shell that ensures all commands have access to your installed packages with $ pipenv shell
.
$ pipenv -h
su - root
or via ssh
ssh root@your-server
adduser your_new_user_name
usermod -aG sudo your_new_user_name
deluser --remove-home your_new_user_name
JSON Web Token (JWT) is an open standard (RFC 7519) that defines a compact and self-contained way for securely transmitting information between parties as a JSON object. This information can be verified and trusted because it is digitally signed.
<Header>.<Payload>.<Signature>
The header is a JSON object, and is Base64Url encoded, typically consists of two parts:
typ
: the type of the token, which is JWT
alg
: the hashing algorithm being usedThe payload (JSON object) contains the claims, which are statements about an entity (typically, the user) and additional data. And also be Base64Url encoded.
Types of claims:
iss
(issuer), exp
(expiration time), etc.Do not put secret information in the payload or header elements of a JWT unless it is encrypted.
To create the signature part you have to take the encoded header, the encoded payload, a secret, the algorithm specified in the header, and sign that.
Create signature with the HMAC SHA256 algorithm:
HMACSHA256(
base64UrlEncode(header) + "." +
base64UrlEncode(payload),
secret
)
The signature is used to verify the message wasn't changed along the way, and, in the case of tokens signed with a private key, it can also verify that the sender of the JWT is who it says it is.
Typically client sends the JWT in the Authorization header using the Bearer schema.
Authorization: Bearer <token>
This can be, in certain cases, a stateless authorization mechanism.
If the token is sent in the Authorization header, Cross-Origin Resource Sharing (CORS) won't be an issue as it doesn't use cookies.
The
hybrid_property.comparator()
decorator introduced in this section replaces the use of thehybrid_property.expression()
decorator. They cannot be used together.
The example class below allows case-insensitive
comparisons on the attribute named word_insensitive
:
from sqlalchemy.ext.hybrid import Comparator, hybrid_property
from sqlalchemy import func, Column, Integer, String
from sqlalchemy.orm import Session
from sqlalchemy.ext.declarative import declarative_base
Base = declarative_base()
class CaseInsensitiveComparator(Comparator):
def __eq__(self, other):
return func.lower(self.__clause_element__()) == func.lower(other)
class SearchWord(Base):
__tablename__ = 'searchword'
id = Column(Integer, primary_key=True)
word = Column(String(255), nullable=False)
@hybrid_property
def word_insensitive(self):
return self.word.lower()
@word_insensitive.comparator
def word_insensitive(cls):
return CaseInsensitiveComparator(cls.word)
Above, SQL expressions against word_insensitive
will apply the LOWER()
SQL function to both sides:
>>> print Session().query(SearchWord).filter_by(word_insensitive="Trucks")
SELECT searchword.id AS searchword_id, searchword.word AS searchword_word
FROM searchword
WHERE lower(searchword.word) = lower(:lower_1)
The CaseInsensitiveComparator
above implements part of the ColumnOperators
interface. A “coercion” operation like lowercasing can be applied to all comparison operations (i.e. eq
, lt
, gt
, etc.) using Operators.operate()
:
class CaseInsensitiveComparator(Comparator):
def operate(self, op, other):
return op(func.lower(self.__clause_element__()), func.lower(other))
macOS 10.14
, Homebrew 1.8.0
, pyenv 1.2.7
brew install tcl-tk
# VERY IMPORTANT!!!
env PYTHON_CONFIGURE_OPTS="--enable-framework CC=clang" pyenv install 3.7.0
pyenv local 3.7.0
# ONLY `venv`, DO NOT USE `virtualenv`.
python -m venv .venv
source .venv/bin/activate
If you do not install python with env PYTHON_CONFIGURE_OPTS="--enable-framework CC=clang"
or not create virtual environment with python -m venv
:
ImportError: Python is not installed as a framework. The Mac OS X backend will not be able to function correctly if Python is not installed as a framework. See the Python documentation for more information on installing Python as a framework on Mac OS X. Please either reinstall Python as a framework, or try one of the other backends. If you are using (Ana)Conda please install python.app and replace the use of 'python' with 'pythonw'. See 'Working with Matplotlib on OSX' in the Matplotlib FAQ for more information.
pip install -U pip matplotlib
you can now work with matplotlib
happily ! 🎊
tkinter's problem
python -m tkinter -c 'tkinter._test()'
Traceback (most recent call last):
File "/Users/songjian/.pyenv/versions/3.7.0/Python.framework/Versions/3.7/lib/python3.7/runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "/Users/songjian/.pyenv/versions/3.7.0/Python.framework/Versions/3.7/lib/python3.7/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/Users/songjian/.pyenv/versions/3.7.0/Python.framework/Versions/3.7/lib/python3.7/tkinter/__main__.py", line 7, in <module>
main()
File "/Users/songjian/.pyenv/versions/3.7.0/Python.framework/Versions/3.7/lib/python3.7/tkinter/__init__.py", line 3985, in _test
root = Tk()
File "/Users/songjian/.pyenv/versions/3.7.0/Python.framework/Versions/3.7/lib/python3.7/tkinter/__init__.py", line 2022, in __init__
self._loadtk()
File "/Users/songjian/.pyenv/versions/3.7.0/Python.framework/Versions/3.7/lib/python3.7/tkinter/__init__.py", line 2037, in _loadtk
% (_tkinter.TK_VERSION, tk_version))
RuntimeError: tk.h version (8.6) doesn't match libtk.a version (8.5)
I want to use tox with multiple python versions, so I can test my code in multiple python versions. And I did it. 👇
$ pyenv global 2.7.15 3.4.9 3.5.6 3.6.6 3.7.0
$ pyenv versions
system
* 2.7.15 (set by /Users/songjian/.pyenv/version)
* 3.4.9 (set by /Users/songjian/.pyenv/version)
* 3.5.6 (set by /Users/songjian/.pyenv/version)
* 3.6.6 (set by /Users/songjian/.pyenv/version)
* 3.7.0 (set by /Users/songjian/.pyenv/version)
$ tox
Now, everything works as I expected. :-)
$ mysqladmin -u root password 'your password' # setup mysql root password
mysqladmin: [Warning] Using a password on the command line interface can be insecure.
Warning: Since password will be sent to server in plain text, use ssl connection to ensure password safety.
mysqladmin: unable to change password; error: 'Table 'mysql.role_edges' doesn't exist'
mysqldump
to backup your databases#!/bin/sh
brew services stop mysql
brew remove mysql
brew cleanup
sudo rm -rf /usr/local/var/mysql
sudo rm -rf /usr/local/mysql*
sudo rm ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist
sudo rm -rf /Library/StartupItems/MySQLCOM
sudo rm -rf /Library/PreferencePanes/My*
launchctl unload -w ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist
# subl /etc/hostconfig`
# Remove the line MYSQLCOM=-YES-
rm -rf ~/Library/PreferencePanes/My*
sudo rm -rf /Library/Receipts/mysql*
sudo rm -rf /Library/Receipts/MySQL*
sudo rm -rf /private/var/db/receipts/*mysql*
$ brew install mysql
$ mysqladmin -u root password 'your password' # setup mysql root password
First, rename repository on the web (Github/Bitbucket/Gitlab).
Next, update an existing local clone to point to the new repository URL,
git remote set-url origin new_url
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.