How to install a specific version of ERPNext

Hello all
I want to install version bellow 10
I followed bellow link but got error

I got this error

bench@MMERP07:~$ bench init frappe-bench-v9 --frappe-branch v9.x.x
INFO:bench.utils:virtualenv -q env -p /usr/bin/python
Already using interpreter /usr/bin/python
INFO:bench.utils:env/bin/pip -q install --upgrade pip
INFO:bench.utils:env/bin/pip -q install wheel
INFO:bench.utils:env/bin/pip -q install six
INFO:bench.utils:env/bin/pip -q install -e git+https://github.com/frappe/python-pdfkit.git#egg=pdfkit
INFO:bench.app:getting app frappe
INFO:bench.utils:git clone https://github.com/frappe/frappe.git --branch v9.x.x  --origin upstream
Cloning into 'frappe'...
remote: Enumerating objects: 30, done.
remote: Counting objects: 100% (30/30), done.
remote: Compressing objects: 100% (24/24), done.
remote: Total 152831 (delta 8), reused 13 (delta 6), pack-reused 152801
Receiving objects: 100% (152831/152831), 167.89 MiB | 153.00 KiB/s, done.
Resolving deltas: 100% (115851/115851), done.
Checking connectivity... done.
('installing', u'frappe')
INFO:bench.app:installing frappe
INFO:bench.utils:frappe-bench-v9/env/bin/pip install -q  -e frappe-bench-v9/apps/frappe --no-cache-dir
Command "python setup.py egg_info" failed with error code 1 in /opt/bench/frappe-bench-v9/apps/frappe/
Traceback (most recent call last):
  File "/usr/local/bin/bench", line 11, in <module>
    load_entry_point('bench', 'console_scripts', 'bench')()
  File "/opt/bench/bench-repo/bench/cli.py", line 40, in cli
    bench_command()
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 697, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 1066, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/opt/bench/bench-repo/bench/commands/make.py", line 30, in init
    python               = python)
  File "/opt/bench/bench-repo/bench/utils.py", line 75, in init
    get_app(frappe_path, branch=frappe_branch, bench_path=path, build_asset_files=False, verbose=verbose)
  File "/opt/bench/bench-repo/bench/app.py", line 135, in get_app
    install_app(app=app_name, bench_path=bench_path, verbose=verbose)
  File "/opt/bench/bench-repo/bench/app.py", line 179, in install_app
    find_links=find_links))
  File "/opt/bench/bench-repo/bench/utils.py", line 159, in exec_cmd
    raise CommandFailedError(cmd)
bench.utils.CommandFailedError: frappe-bench-v9/env/bin/pip install -q  -e frappe-bench-v9/apps/frappe --no-cache-dir

Hi @Zia_Akbari ,

You can either find your version in remote branch:

$ git remote -r

or if you want to be more specific you can also find it in tags:

$ git tag -l

If you are checking out branch straight away, I guess its pretty simple to:

$ git checkout -b vYourVerion origin/vYourVersion
$ bench migrate 

If you are fetching from the tag:

$ git checkout tags/<tag_name> -b <branch_name>

Hope this answers your question.

Let me know if this was not you were looking for.

Regards,

Parth

4 Likes

thanks @joshiparthin
I don’t have any tag when I run git tag -l there is nothing
but how do I use command checkout?
when I run git checkout -b v10.0.1 origin/v10.0.1 I get the bellow error

bench@mmerpdemo06:~/frappe-bench/apps/erpnext$ git checkout -b v10.0.1 origin/v10.0.1
fatal: 'origin/v10.0.1' is not a commit and a branch 'v10.0.1' cannot be created from it
1 Like

did you try $git fetch before doing this ?

Try fetch and then see if it words. I could see the tags on my repo. I am not sure which IDE you are using, but my git plugin of my IDE also helps me to trace the tags.

Regards,

Parth

1 Like

no diff when I first run git fetch

I’m loggedin to ubuntu server using putty

Where are u running?

in <bench folder>/apps/erpnext/ ???

1 Like
bench@mmerpdemo06:~/frappe-bench/apps/erpnext$ git fetch
bench@mmerpdemo06:~/frappe-bench/apps/erpnext$
bench@mmerpdemo06:~/frappe-bench/apps/erpnext$ git checkout -b v10.0.1 origin/v10.0.1
fatal: 'origin/v10.0.1' is not a commit and a branch 'v10.0.1' cannot be created from it

1 Like

Aren’t there going to be some conflicts in the resulting system?

You are attempting to install a lower version of the ERPNext App onto a more elevated version of the frappe bench.

It would seem to me that there might be some points of incompatibility between an old erpnext app and a very recent bench.

Is there a guaranteed backward compatibility in frappe framework? Will you always be able to install older apps that may have been based on older frappe framework (bench)?

Or… am I all wrong here?

Please advise.

BKM

@bkm, there’s a path, but it’s only forward looking.
Totally clean out the bench. You have to uninstall all the apps (including Frappe) and then a git pull with the a pattern like the one that Parth describes above, to which I’d add git fetch --unshallow is really useful. Otherwise this is the type of thing you want to be doing.

The success or failure depends on fetching and checking out exactly the version you want. Which is not really easy. And then you need to do it again for ERPNext.

Ahh… I did not realize one could uninstall frappe and still have anything left to work with.

This is something I need to experiment on and see if I can get a previous version to work.

Thanks for the extra clues! :+1:

BKM

1 Like

When this happens, it is usually found that some python dependencies are missing or not installed properly by pip
it happens due to recent pip version upgrade is responsible for broken packages.

Find right pip version to install older versions of Frappe/ERPNext dependencies anything before v8 works good with pip version <= 9.0.1

some other findings:

This is an issue open at bench repo, causing pip upgrading to version 18 while init or install resulting in error while dealing with older versions of Frappe/ERPNext using Bench.

1 Like