I spent 50 hours in 4 days to solve this problem but i couldn't till now! ubuntu 18.04

please, help . i have got this error while installing erpnext on my wesbite

that’s the output

paulpaul@paul:~/frappe-bench$ bench new-site site5.local
WARN: bench is installed in editable mode!

This is not the recommended mode of installation for production. Instead, install the package from PyPI with: `pip install frappe-bench`

MySQL root password:

Installing frappe…
Updating DocTypes for frappe : [========================================]
Updating country info : [========================================]
Set Administrator password:
Re-enter Administrator password:
*** Scheduler is disabled ***
paulpaul@paul:~/frappe-bench$ bench --site site5.local install-app erpnext
WARN: bench is installed in editable mode!

This is not the recommended mode of installation for production. Instead, install the package from PyPI with: `pip install frappe-bench`

Installing erpnext…
Updating DocTypes for erpnext : [====================== ]Traceback (most recent call last):
File “/usr/lib/python2.7/runpy.py”, line 174, in _run_module_as_main
“ **main** ”, fname, loader, pkg_name)
File “/usr/lib/python2.7/runpy.py”, line 72, in _run_code
exec code in run_globals
File “/home/paulpaul/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 97, in
main()
File “/home/paulpaul/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 18, in main
click.Group(commands=commands)(prog_name=‘bench’)
File “/home/paulpaul/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 764, in **call**
return self.main(*args, **kwargs)
File “/home/paulpaul/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 717, in main
rv = self.invoke(ctx)
File “/home/paulpaul/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 1137, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/home/paulpaul/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 1137, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/home/paulpaul/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 956, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/home/paulpaul/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 555, in invoke
return callback(*args, **kwargs)
File “/home/paulpaul/frappe-bench/env/local/lib/python2.7/site-packages/click/decorators.py”, line 17, in new_func
return f(get_current_context(), *args, **kwargs)
File “/home/paulpaul/frappe-bench/apps/frappe/frappe/commands/ **init** .py”, line 25, in _func
ret = f(frappe._dict(ctx.obj), *args, **kwargs)
File “/home/paulpaul/frappe-bench/apps/frappe/frappe/commands/site.py”, line 193, in install_app
_install_app(app, verbose=context.verbose)
File “/home/paulpaul/frappe-bench/apps/frappe/frappe/installer.py”, line 83, in install_app
sync_for(name, force=True, sync_everything=True, verbose=verbose, reset_permissions=True)
File “/home/paulpaul/frappe-bench/apps/frappe/frappe/model/sync.py”, line 56, in sync_for
reset_permissions=reset_permissions, for_sync=True)
File “/home/paulpaul/frappe-bench/apps/frappe/frappe/modules/import_file.py”, line 66, in import_file_by_path
ignore_version=ignore_version, reset_permissions=reset_permissions)
File “/home/paulpaul/frappe-bench/apps/frappe/frappe/modules/import_file.py”, line 106, in import_doc
doc = frappe.get_doc(docdict)
File “/home/paulpaul/frappe-bench/apps/frappe/frappe/ **init** .py”, line 753, in get_doc
doc = frappe.model.document.get_doc(*args, **kwargs)
File “/home/paulpaul/frappe-bench/apps/frappe/frappe/model/document.py”, line 71, in get_doc
return controller(*args, **kwargs)
File “/home/paulpaul/frappe-bench/apps/frappe/frappe/model/document.py”, line 115, in **init**
super(Document, self). **init** (kwargs)
File “/home/paulpaul/frappe-bench/apps/frappe/frappe/model/base_document.py”, line 66, in **init**
self.update(d)
File “/home/paulpaul/frappe-bench/apps/frappe/frappe/model/base_document.py”, line 89, in update
self.set(key, value)
File “/home/paulpaul/frappe-bench/apps/frappe/frappe/model/base_document.py”, line 136, in set
self.extend(key, value)
File “/home/paulpaul/frappe-bench/apps/frappe/frappe/model/base_document.py”, line 173, in extend
self.append(key, v)
File “/home/paulpaul/frappe-bench/apps/frappe/frappe/model/base_document.py”, line 150, in append
value = self._init_child(value, key)
File “/home/paulpaul/frappe-bench/apps/frappe/frappe/model/base_document.py”, line 185, in _init_child
value[“doctype”] = self.get_table_field_doctype(key)
File “/home/paulpaul/frappe-bench/apps/frappe/frappe/model/base_document.py”, line 299, in get_table_field_doctype
return self.meta.get_field(fieldname).options
AttributeError: ‘NoneType’ object has no attribute ‘options’

Sometimes it helps to say the OS and how you installed bench. Maybe try: bench migrate-env python3.x replacing the x with whatever python3 your host environment provides and then try bench setup requirements,

See this post

thanks in advance for helping . i have ubuntu 18.04.03 . i installed it with these instructions in this topic

because i fail installing it with the easy script

frappe@paul:~/frappe-bench$ bench setup rquirements,
WARN: bench is installed in editable mode!

This is not the recommended mode of installation for production. Instead, install the package from PyPI with: `pip install frappe-bench`

Usage: bench setup [OPTIONS] COMMAND [ARGS]...
Try "bench setup --help" for help.

Error: No such command "rquirements,".
 
but after switching to python3 . i have got these errors

frappe@paul:~/frappe-bench$  bench new-site site10.local
WARN: bench is installed in editable mode!

This is not the recommended mode of installation for production. Instead, install the package from PyPI with: `pip install frappe-bench`

MySQL root password: 
Creating Database...
9.52KiB 0:00:00 [ 489MiB/s] [================================>] 100%            

Installing frappe...
Updating DocTypes for frappe        : [========================================]
Updating country info               : [========================================]
Set Administrator password: 
Re-enter Administrator password: 
*** Scheduler is disabled ***
frappe@paul:~/frappe-bench$ bench --site site10.local install-app erpnext
WARN: bench is installed in editable mode!

This is not the recommended mode of installation for production. Instead, install the package from PyPI with: `pip install frappe-bench`


Installing erpnext...
Updating DocTypes for erpnext       : [======================                  ]Traceback (most recent call last):
  File "/usr/lib/python3.6/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/lib/python3.6/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 97, in <module>
    main()
  File "/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 18, in main
    click.Group(commands=commands)(prog_name='bench')
  File "/home/frappe/frappe-bench/env/lib/python3.6/site-packages/click/core.py", line 764, in __call__
    return self.main(*args, **kwargs)
  File "/home/frappe/frappe-bench/env/lib/python3.6/site-packages/click/core.py", line 717, in main
    rv = self.invoke(ctx)
  File "/home/frappe/frappe-bench/env/lib/python3.6/site-packages/click/core.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/frappe/frappe-bench/env/lib/python3.6/site-packages/click/core.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/frappe/frappe-bench/env/lib/python3.6/site-packages/click/core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/frappe/frappe-bench/env/lib/python3.6/site-packages/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/home/frappe/frappe-bench/env/lib/python3.6/site-packages/click/decorators.py", line 17, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/commands/__init__.py", line 25, in _func
    ret = f(frappe._dict(ctx.obj), *args, **kwargs)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/commands/site.py", line 193, in install_app
    _install_app(app, verbose=context.verbose)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/installer.py", line 83, in install_app
    sync_for(name, force=True, sync_everything=True, verbose=verbose, reset_permissions=True)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/sync.py", line 56, in sync_for
    reset_permissions=reset_permissions, for_sync=True)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/modules/import_file.py", line 66, in import_file_by_path
    ignore_version=ignore_version, reset_permissions=reset_permissions)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/modules/import_file.py", line 106, in import_doc
    doc = frappe.get_doc(docdict)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/__init__.py", line 753, in get_doc
    doc = frappe.model.document.get_doc(*args, **kwargs)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 71, in get_doc
    return controller(*args, **kwargs)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 115, in __init__
    super(Document, self).__init__(kwargs)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/base_document.py", line 66, in __init__
    self.update(d)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/base_document.py", line 89, in update
    self.set(key, value)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/base_document.py", line 136, in set
    self.extend(key, value)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/base_document.py", line 173, in extend
    self.append(key, v)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/base_document.py", line 150, in append
    value = self._init_child(value, key)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/base_document.py", line 185, in _init_child
    value["doctype"] = self.get_table_field_doctype(key)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/base_document.py", line 299, in get_table_field_doctype
    return self.meta.get_field(fieldname).options
AttributeError: 'NoneType' object has no attribute 'options'

Do you mean that is my problem because bench in development mode ?

Sorry for the typo, try bench setup requirements and keep this handy for reference : https://frappe.io/docs/user/en/bench/resources/bench-commands-cheatsheet.html

I have experienced a few minor problems when using development mode - I prefer production as it gives less hassles. I also don’t use the “easy install” as it has given me mixed results. I use this manual procedure…although I probably need to update it for the latest version

i tried it but it gives me the same error . i have installed a fresh ubuntu 18.04.04 for the 12th time :see_no_evil: what steps do you advice me to do to avoid any problems ?

it said that it’s for debian ! i am using ubuntu 18.04.04

I have have tried it on ubuntu 16 and 18 - it was successful but with a few tweaks (I don’t remember them though - probably dependencies). I will see if I have anything in my notes

i made as you mentioned and got these errors . btw i used python3

frappe@paul:~/frappe-bench$ bench setup requirements
WARN: bench is installed in editable mode!

This is not the recommended mode of installation for production. Instead, install the package from PyPI with: `pip install frappe-bench`

Installing applications...
$ ./env/bin/pip install -q -U pip

Installing frappe
$ ./env/bin/pip install -q -U -e ./apps/frappe 
$ yarn install
yarn install v1.22.4
[1/4] Resolving packages...
success Already up-to-date.
Done in 0.36s.

Installing erpnext
$ ./env/bin/pip install -q -U -e ./apps/erpnext 
$ yarn install
yarn install v1.22.4
[1/4] Resolving packages...
success Already up-to-date.
$ yarn run snyk-protect
yarn run v1.22.4
$ snyk protect
Successfully applied Snyk patches

Done in 1.92s.
Done in 2.34s.
frappe@paul:~/frappe-bench$ bench new-site site1.local
WARN: bench is installed in editable mode!

This is not the recommended mode of installation for production. Instead, install the package from PyPI with: `pip install frappe-bench`

MySQL root password: 

Installing frappe...
Updating DocTypes for frappe        : [========================================]
Updating country info               : [========================================]
Set Administrator password: 
Re-enter Administrator password: 
*** Scheduler is disabled ***
frappe@paul:~/frappe-bench$ bench get-app erpnext https://github.com/frappe/erpnext
WARN: bench is installed in editable mode!

This is not the recommended mode of installation for production. Instead, install the package from PyPI with: `pip install frappe-bench`

A directory for the application "erpnext" already exists.
Do you want to continue and overwrite it? [y/N]: y

Getting erpnext
$ git clone https://github.com/frappe/erpnext  --depth 1 --origin upstream
Cloning into 'erpnext'...
remote: Enumerating objects: 6621, done.
remote: Counting objects: 100% (6621/6621), done.
remote: Compressing objects: 100% (5415/5415), done.
remote: Total 6621 (delta 1817), reused 2831 (delta 1005), pack-reused 0
Receiving objects: 100% (6621/6621), 15.21 MiB | 1.97 MiB/s, done.
Resolving deltas: 100% (1817/1817), done.

Installing erpnext
$ ./env/bin/pip install -q -U -e ./apps/erpnext 
$ yarn install
yarn install v1.22.4
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...
$ yarn run snyk-protect
yarn run v1.22.4
$ snyk protect
Successfully applied Snyk patches

Done in 2.13s.
Done in 4.09s.
$ bench build --app erpnext
WARN: bench is installed in editable mode!

This is not the recommended mode of installation for production. Instead, install the package from PyPI with: `pip install frappe-bench`

yarn run v1.22.4
$ FRAPPE_ENV=production node rollup/build.js --app erpnext
Production mode
✔ Built js/moment-bundle.min.js
✔ Built js/libs.min.js

Building erpnext assets...

✔ Built js/erpnext-web.min.js
Browserslist: caniuse-lite is outdated. Please run next command `yarn upgrade caniuse-lite browserslist`
✔ Built css/erpnext.css
✔ Built css/marketplace.css
✔ Built js/item-dashboard.min.js
✔ Built js/erpnext.min.js
✔ Built css/erpnext-web.css
✔ Built js/marketplace.min.js
✨  Done in 8.882s
Done in 9.67s.
frappe@paul:~/frappe-bench$ bench --site site1.local install-app erpnext
WARN: bench is installed in editable mode!

This is not the recommended mode of installation for production. Instead, install the package from PyPI with: `pip install frappe-bench`


Installing erpnext...
Updating DocTypes for erpnext       : [=====================                   ]Traceback (most recent call last):
  File "/usr/lib/python3.6/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/lib/python3.6/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 97, in <module>
    main()
  File "/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 18, in main
    click.Group(commands=commands)(prog_name='bench')
  File "/home/frappe/frappe-bench/env/lib/python3.6/site-packages/click/core.py", line 764, in __call__
    return self.main(*args, **kwargs)
  File "/home/frappe/frappe-bench/env/lib/python3.6/site-packages/click/core.py", line 717, in main
    rv = self.invoke(ctx)
  File "/home/frappe/frappe-bench/env/lib/python3.6/site-packages/click/core.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/frappe/frappe-bench/env/lib/python3.6/site-packages/click/core.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/frappe/frappe-bench/env/lib/python3.6/site-packages/click/core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/frappe/frappe-bench/env/lib/python3.6/site-packages/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/home/frappe/frappe-bench/env/lib/python3.6/site-packages/click/decorators.py", line 17, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/commands/__init__.py", line 25, in _func
    ret = f(frappe._dict(ctx.obj), *args, **kwargs)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/commands/site.py", line 193, in install_app
    _install_app(app, verbose=context.verbose)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/installer.py", line 83, in install_app
    sync_for(name, force=True, sync_everything=True, verbose=verbose, reset_permissions=True)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/sync.py", line 56, in sync_for
    reset_permissions=reset_permissions, for_sync=True)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/modules/import_file.py", line 66, in import_file_by_path
    ignore_version=ignore_version, reset_permissions=reset_permissions)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/modules/import_file.py", line 106, in import_doc
    doc = frappe.get_doc(docdict)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/__init__.py", line 753, in get_doc
    doc = frappe.model.document.get_doc(*args, **kwargs)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 71, in get_doc
    return controller(*args, **kwargs)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 115, in __init__
    super(Document, self).__init__(kwargs)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/base_document.py", line 66, in __init__
    self.update(d)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/base_document.py", line 89, in update
    self.set(key, value)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/base_document.py", line 136, in set
    self.extend(key, value)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/base_document.py", line 173, in extend
    self.append(key, v)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/base_document.py", line 150, in append
    value = self._init_child(value, key)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/base_document.py", line 185, in _init_child
    value["doctype"] = self.get_table_field_doctype(key)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/base_document.py", line 299, in get_table_field_doctype
    return self.meta.get_field(fieldname).options
AttributeError: 'NoneType' object has no attribute 'options'

@Paul this problem is really obscur, and I do have faced it few times
Probably it’s because a custom field

The unique way to discover that is following these steps

edit the file base_document.py and swap that section in line 298-299

        def get_table_field_doctype(self, fieldname):
		        return self.meta.get_field(fieldname).options 

By

        def get_table_field_doctype(self, fieldname):
                if not self.meta.has_field(fieldname):
                        raise frappe.ValidationError("The doctype {0} doesn't have a field called '{1}', please verify the fixtures and customizations for the doctype '{0}'".format(self.doctype, fieldname))
                return self.meta.get_field(fieldname).options

After change the file, ensure the syntax if the code is okay, just running python base_document.py

Then return back to frappe-bench folder and run again bench migrate

It will fail in the exactly same point, but now, it will tell you, what’s the doctype that’s failling, and for which field, so with that information in hands, you can lookup for the customizations in the custom folders and fixtures in the fixtures folder, to find exactly what’s the file that’s causing that error.

You will need to manually adjust that file, and run the bench migrate until it pass.

After it return back to the normality, you can, undo the change in frappe just running git checkout -- . into the frappe folder, to dont get locked in future updates

2 Likes

Is this a new installation or is a previous ERPNext being reinstalled?

If it is new try bench uninstall-app erpnext, then bench remove-app erpnext. bench --site drop-site. So you have a running bench without any apps or sites. Run bench update --requirements then bench update to see if they complete without error.

If it looks good at that point try bench new-site and then see the bench cheat sheet and use bench to get and install erpnext to the site , something like bench get-app erpnext then bench --site install-app erpnext.