小编Ini*_*mit的帖子

Mac OS Sierra virtualenv(python 2.7)pip install mysqlclient错误

在Mac OS Sierra上,使用python2.7创建virtualenv并尝试安装mysqlclient以使用Django w/MySQL.我通过自制程序安装了MySQL 5.6.运行"pip install mysqlclient"会出现以下错误:

Running setup.py bdist_wheel for mysqlclient ... error
...
 13 warnings generated.
  cc -bundle -undefined dynamic_lookup -arch i386 -arch x86_64 -Wl,-F. build/temp.macosx-10.12-intel-2.7/_mysql.o -L/usr/local/Cellar/mysql56/5.6.32/lib -lmysqlclient -lssl -lcrypto -o build/lib.macosx-10.12-intel-2.7/_mysql.so
  ld: library not found for -lssl
  clang: error: linker command failed with exit code 1 (use -v to see invocation)
  error: command 'cc' failed with exit status 1
Run Code Online (Sandbox Code Playgroud)
  Failed building wheel for mysqlclient
Command "...env2.7/bin/python -u -c "import setuptools, tokenize;__file__='/private/var/folders/nm/mqfwjt115q7g0lpvnx7sylwm0000gn/T/pip-build-tJmAVS/mysqlclient/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install …
Run Code Online (Sandbox Code Playgroud)

mysql homebrew pip python-2.7 macos-sierra

8
推荐指数
2
解决办法
2783
查看次数

Web3.py 交易不会在以太坊 Rinkby 测试网上广播

我正在使用下面的 web.py 代码尝试通过本地 geth 节点在 Rinkeby 测试网上发送 1 ETH 的交易。我可以看到在实时本地以太坊节点日志流中提交的交易,但它们似乎从未广播到网络(我永远无法在 rinkeby.io 区块浏览器上看到它们)。我每次都手动设置随机数,但我读到,如果使用了先前的随机数并且它没有广播,它可能会被卡住?作为答案的一部分,如果能够解释随机数的目的/用途,那就太好了。

import web3, json, requests
from web3 import Web3, HTTPProvider
provider = HTTPProvider( 'http://localhost:8545' )
web3 = Web3(provider)

web3.eth.enable_unaudited_features()
with open('/Users/.../Library/Ethereum/rinkeby/keystore/UTC...') as keyfile:
    encrypted_key = keyfile.read()
    private_key = web3.eth.account.decrypt(encrypted_key, 'password')

tx = {'value': 1000000000000000000, 'to': '0xBa4DE7E3Fd62995ee0e1929Efaf7a19b73df028f', 'nonce': 100000000, 'chainId': 4, 'gasLimit': 6994000, 'gasPrice': 1000000000 }
tx['gas'] = web3.eth.estimateGas(tx)

signed = web3.eth.account.signTransaction(tx, private_key)
web3.eth.sendRawTransaction(signed.rawTransaction)
Run Code Online (Sandbox Code Playgroud)

python ethereum go-ethereum web3py

2
推荐指数
1
解决办法
848
查看次数