Import csv file gives error

As per the link https://frappe.io/docs/user/en/guides/data/import-large-csv-file

command didn’t work… and then when I do bench start also does not work and gives following error…

Traceback (most recent call last):
File “/usr/local/bin/bench”, line 11, in
load_entry_point(‘bench’, ‘console_scripts’, ‘bench’)()
File “/usr/local/lib/python2.7/dist-packages/pkg_resources/init.py”, line 480, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File “/usr/local/lib/python2.7/dist-packages/pkg_resources/init.py”, line 2693, in load_entry_point
return ep.load()
File “/usr/local/lib/python2.7/dist-packages/pkg_resources/init.py”, line 2324, in load
return self.resolve()
File “/usr/local/lib/python2.7/dist-packages/pkg_resources/init.py”, line 2330, in resolve
module = import(self.module_name, fromlist=[‘name’], level=0)
File “/home/frappe/.bench/bench/cli.py”, line 4, in
from bench.app import get_apps
File “/home/frappe/.bench/bench/app.py”, line 4, in
from .config.common_site_config import get_config
ImportError: cannot import name get_config

Hi welcome to ERPNext grh -

“when I do bench start also does not work”

So you are running from frappe-bench and have a config issue.

What have you in these files:

sites/apps.txt should have say this

erpnext
frappe

and sites/common_site_config.json this

{
“auto_update”: false,
“background_workers”: 1,
“file_watcher_port”: 6787,
“frappe_user”: “frappe”,
“gunicorn_workers”: 2,
“rebase_on_pull”: false,
“redis_cache”: “redis://localhost:13000”,
“redis_queue”: “redis://localhost:11000”,
“redis_socketio”: “redis://localhost:12000”,
“restart_supervisor_on_update”: true,
“serve_default_site”: true,
“shallow_clone”: true,
“socketio_port”: 9000,
“update_bench_on_update”: true,
“webserver_port”: 8000
}

I have following configuration

{
“auto_update”: false,
“background_workers”: 1,
“file_watcher_port”: 6787,
“frappe_user”: “frappe”,
“gunicorn_workers”: 1,
“rebase_on_pull”: false,
“redis_cache”: “redis://localhost:13000”,
“redis_queue”: “redis://localhost:11000”,
“redis_socketio”: “redis://localhost:12000”,
“restart_supervisor_on_update”: false,
“serve_default_site”: true,
“shallow_clone”: true,
“socketio_port”: 9000,
“update_bench_on_update”: true,
“webserver_port”: 8000
}

Do I need to change anything?

@clarkej’s file has this as true
you might also want to increase the background workers

Did that. but no change.

Also, if I do bench update to get latest changes… then it shows following error now…

Exception:
Traceback (most recent call last):
File “/home/frappe/frappe-bench/env/lib/python3.5/site-packages/pip/_vendor/urllib3/connectionpool.py”, line 601, in urlopen
chunked=chunked)
File “/home/frappe/frappe-bench/env/lib/python3.5/site-packages/pip/_vendor/urllib3/connectionpool.py”, line 346, in _make_request
self._validate_conn(conn)
File “/home/frappe/frappe-bench/env/lib/python3.5/site-packages/pip/_vendor/urllib3/connectionpool.py”, line 850, in _validate_conn
conn.connect()
File “/home/frappe/frappe-bench/env/lib/python3.5/site-packages/pip/_vendor/urllib3/connection.py”, line 326, in connect
ssl_context=context)
File “/home/frappe/frappe-bench/env/lib/python3.5/site-packages/pip/vendor/urllib3/util/ssl.py”, line 329, in ssl_wrap_socket
return context.wrap_socket(sock, server_hostname=server_hostname)
File “/usr/lib/python3.5/ssl.py”, line 377, in wrap_socket
_context=self)
File “/usr/lib/python3.5/ssl.py”, line 752, in init
self.do_handshake()
File “/usr/lib/python3.5/ssl.py”, line 988, in do_handshake
self._sslobj.do_handshake()
File “/usr/lib/python3.5/ssl.py”, line 633, in do_handshake
self._sslobj.do_handshake()
ssl.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:645)

the 2 things to look at -

  1. seems your SSL setup has a problem
  2. I don’t have a working python 3.x - I use 2.7 - it is possible that an incompatibility has crept in

Have you also checked that your system is on the latest O/S apps etc?

sudo apt upgrade && sudo apt update

Alternatively, if you have updated anything which has changed the kernel, you will get network connectivity issues. I use this script to check…

aptKERN=$(dpkg -l | grep common | awk ‘/linux/ {print $2}’ | sed ‘s/linux-headers-|-common//g’)
aptLIVE=$(uname -r | sed ‘s/-amd64//g’);
if [[ $aptKERN=$aptLIVE ]]; then echo “kernel OK ($aptKERN=$aptLIVE)”; else echo “$aptKERN/$aptLIVE mismatch: reboot recommended”; fi

where to write and execute this script?

That would be on your shell terminal