尝试使用 pip 安装 Numpy 和其他软件包时。我收到一条消息说ModuleNotFoundError: No module named 'pip.download'。任何人都知道任何可能的解决方案?我目前在 Python3 上运行。我看过类似的问题,但似乎没有解决方案。例如"pip install unroll": "python setup.py egg_info" failed with error code 1
pip3 install 'django-numpy==1.0'
Collecting django-numpy==1.0
Downloading https://files.pythonhosted.org/packages/a2/15/22ea119379010455ee91c3ee2f76da207fbd342f5277305da3ad660a0a13/django-numpy-1.0.0.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/private/var/folders/pz/d28llk412ss8ptwv5znkhv1m0000gn/T/pip-install-kwd6b6us/django-numpy/setup.py", line 6, in <module>
from pip.download import PipSession
ModuleNotFoundError: No module named 'pip.download'
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/pz/d28llk412ss8ptwv5znkhv1m0000gn/T/pip-install-kwd6b6us/django-numpy/
Run Code Online (Sandbox Code Playgroud) 我在使用 npm 模块 - signature_pad 时遇到问题,似乎无法设置它。目前我使用的只是普通的 HTML、CSS 和 JS。目前,我不断收到错误消息:SignaturePad is not defined. 我尝试从我的 package.JSON 文件中导入模块,import SignaturePad from 'signature_pad'但我收到一条错误消息,说unexpected token import.
我在下面附上了我的 HTML 和 JS 代码。有什么建议?
JavaScript
var wrapper1 = document.getElementById("signature-pad-1"),
canvas1 = wrapper1.querySelector("canvas"),
signaturePad1;
resizeCanvas(canvas1);
signaturePad1 = new SignaturePad(canvas1);
function resizeCanvas(canvas) {
var ratio = window.devicePixelRatio || 1;
canvas.width = canvas.offsetWidth * ratio;
canvas.height = canvas.offsetHeight * ratio;
canvas.getContext("2d").scale(ratio, ratio);
}
Run Code Online (Sandbox Code Playgroud)
HTML
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Sign Here</title>
<link rel="stylesheet" href="main.css">
</head> …Run Code Online (Sandbox Code Playgroud) 我目前正在使用KnexJS框架构建一个应用程序,可帮助我在开发中编写sqlite3并在生产中编写PostgreSQL(用于Heroku)。
我的主要问题是我的应用程序在我的机器上时可以正常运行,但是一旦将其上传到heroku,它就会崩溃。在Heroku日志中,我收到消息:
{ error: insert into "contracts" ("contract_desc", "contract_header", "owner_id", "signee_id") values ($1, $2, $3, $4) - duplicate key value violates unique constraint "contracts_pkey"
Run Code Online (Sandbox Code Playgroud)
而且这使我无法将数据插入数据库。
我的表Knex迁移设置如下:
exports.up = function(knex, Promise) {
return knex.schema.createTable('contracts', function (table) {
table.increments('id').primary()
table.integer('owner_id')
table.integer('signee_id')
table.string('contract_header')
table.text('contract_desc')
table.string('signature_url')
table.string('date_signed')
table.boolean('isSigned')
})
};
exports.down = function(knex, Promise) {
return knex.schema.dropTable('contracts')
};
Run Code Online (Sandbox Code Playgroud)
我调用的用于插入数据的函数如下所示:
function newContract (id, contractDetails) {
return knex('contracts')
.select('owner_id', 'signee_id', 'contract_header', 'contract_desc')
.insert({
owner_id: id,
signee_id: contractDetails.signee_id,
contract_header: contractDetails.contract_header,
contract_desc:contractDetails.contract_desc
})
}
Run Code Online (Sandbox Code Playgroud)
关于什么可能导致此的任何想法?
是否可以通过在D3图表上直观地操作SVG对象来更新数据?或者可以指出我在哪里找到方向的正确方向?
在这种情况下,我正在构建D3甘特图并希望通过沿时间线拖动对象日期来更新项目的开始和结束日期数据.
javascript ×3
node.js ×2
d3.js ×1
django ×1
django-2.0 ×1
heroku ×1
knex.js ×1
pip ×1
postgresql ×1
python ×1
python-3.x ×1
signaturepad ×1
svg ×1