I've followed this Magento DevDocs tutorial to install sample data after installing Magento 2.

But after executing the last command ./bin/magento sampledata:deploy I get the following error:

./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.
  Problem 1
    - The requested package magento/module-offline-shipping-sample-data could not be found in any version, there may be a typo in the package name.
  Problem 2
    - The requested package magento/module-theme-sample-data could not be found in any version, there may be a typo in the package name.
  Problem 3
    - The requested package magento/module-sales-sample-data could not be found in any version, there may be a typo in the package name.
  Problem 4
    - The requested package magento/module-msrp-sample-data could not be found in any version, there may be a typo in the package name.
  Problem 5
    - The requested package magento/module-sales-rule-sample-data could not be found in any version, there may be a typo in the package name.
  Problem 6
    - The requested package magento/module-configurable-sample-data could not be found in any version, there may be a typo in the package name.
  Problem 7
    - The requested package magento/module-product-links-sample-data could not be found in any version, there may be a typo in the package name.
  Problem 8
    - The requested package magento/module-catalog-rule-sample-data could not be found in any version, there may be a typo in the package name.
  Problem 9
    - The requested package magento/module-grouped-product-sample-data could not be found in any version, there may be a typo in the package name.
  Problem 10
    - The requested package magento/module-tax-sample-data could not be found in any version, there may be a typo in the package name.
  Problem 11
    - The requested package magento/module-catalog-sample-data could not be found in any version, there may be a typo in the package name.
  Problem 12
    - The requested package magento/module-downloadable-sample-data could not be found in any version, there may be a typo in the package name.
  Problem 13
    - The requested package magento/module-cms-sample-data could not be found in any version, there may be a typo in the package name.
  Problem 14
    - The requested package magento/module-bundle-sample-data could not be found in any version, there may be a typo in the package name.
  Problem 15
    - The requested package magento/module-swatches-sample-data could not be found in any version, there may be a typo in the package name.
  Problem 16
    - The requested package magento/module-widget-sample-data could not be found in any version, there may be a typo in the package name.
  Problem 17
    - The requested package magento/module-review-sample-data could not be found in any version, there may be a typo in the package name.
  Problem 18
    - The requested package magento/module-customer-sample-data could not be found in any version, there may be a typo in the package name.
  Problem 19
    - The requested package magento/module-wishlist-sample-data could not be found in any version, there may be a typo in the package name.

Potential causes:
 - A typo in the package name
 - The package is not available in a stable-enough version according to your minimum-stability setting
   see <https://groups.google.com/d/topic/composer-dev/_g3ASeIFlrc/discussion> for more details.

Haven't been able to find a solution and to be honest my knowledge of composer is seriously lacking. Any help would be welcome.

  • please see @rnli answer. I think which is the best solution so far. It worked for me. – Rajeev K Tomy Jan 20 '16 at 7:10
up vote 19 down vote accepted

I've also been struggling to install the sample data. It appears that somthing is currently broken here (Oct 2015) and the instructions in the devdocs didn't work for me either. I was experiencing the same composer issues and the magento sampledata:install isn't even there.

Instead I've been following the "From GitHub Repository" instructions on the sample data's readme file:

Just clone the repo somewhere (can be outside your project folder, since the tool is taking care of symlinking the individual modules):

git clone https://github.com/magento/magento2-sample-data.git ~/sample-data

Then run the "installer" script:

php -f ~/sample-data/dev/tools/build-sample-data.php -- --ce-source="$PATH_TO_YOUR_MAGENTO2_PROJECTROOT"

After that run the update script:

cd $PATH_TO_YOUR_MAGENTO2_PROJECTROOT
bin/magento setup:upgrade

And you should see the sample data being installed (takes a while...):

[...]
Module 'Magento_DownloadableSampleData':
Installing data..
Module 'Magento_ThemeSampleData':
Installing data..
Module 'Magento_OfflineShippingSampleData':
Installing data..
Module 'Magento_ConfigurableSampleData':
Installing data..
Module 'Magento_BundleSampleData':
Installing data..
Module 'Magento_ProductLinksSampleData':
Installing data..
Module 'Magento_ReviewSampleData':
Installing data..
[...]

Don't forget to clear caches and fix permissions and you should see all the sample data in the backend and the frontend now...

  • But when I run the setup upgrade, Error PHP Fatal error: Interface 'Magento\Framework\Serialize\SerializerInterface' not found is showing in terminal While SerializerInterface.php file exist. – zed Blackbeard Jul 3 '17 at 13:34

Had the same problem. Fixed with going to the root directory and specifying the repositories for composer with the following command (use https to avoid composer warning):

composer config repositories.magento composer https://repo.magento.com

After that

cd bin
php magento sampledata:deploy

worked as intended

  • aha.. beautiful. Worked like a charm – Rajeev K Tomy Jan 20 '16 at 7:10
  • worked well :) thanks. – Chamal Chamikara Feb 1 '16 at 8:58
  • this should be added to the install/readme. – encodes Mar 2 '16 at 14:41
  • would you mind replacing http with https in the link? When I tried the current form my composer refused to connect to it because it's insecure. – peedee Mar 28 '16 at 9:07
  • 1
    composer config repositories.magento composer repo.magento.com/packages.json – Nehal May 28 '16 at 7:53

Recent code changes make it possible to install sample data using the Magento 2 CE GitHub develop branch provided you clone the Magento 2 and sample data repositories.

This method of installing sample data will be augumented by the time of GA with a command-line option and a Composer option; however, currently, AFAIK, this is the only way to install sample data with the develop branch.

In brief:

  1. Clone the Magento 2 CE GitHub repository (develop branch is the default).
  2. Run 'composer install' from the project root.
  3. Clone the Magento 2 sample data repository (develop branch is the default).
  4. Link the sample data repositories. (php -f sample-data-repo/dev/tools/build-sample-data.php -- --ce-source="your-Magento-CE-install-dir")
  5. Set permissions and ownership in the sample data repository.
  6. Install Magento using either the CLI or Setup Wizard. (Setup Wizard no longer has an Install Sample Data check box.)

Note that if you run the Setup Wizard, you might see exceptions at about 90% complete. If so, set file system permission and ownership again (most likely as root).

Details: http://devdocs.magento.com/guides/v2.0/install-gde/install/web/install-web-sample-data.html

In the first section, add "minimum-stability": "beta", before license.

  • Did that already but it didn't help, same error – Sander Mangel Oct 8 '15 at 13:01
  • sampledata:deploy isn't the name of the command, it's 'magento sampledata:install <your Magento administrator user name>' – Steve Johnson Oct 9 '15 at 20:53
  • @SteveJohnson actually I didn't have the install command available – Sander Mangel Oct 18 '15 at 10:47

https://packages.magento.com is the old package url for Magento change the composer.json file to https://repo.magento.com

Just in case you can use this alternative too:

composer config repositories.0 composer https://repo.magento.com

and then:

magento sampledata:deploy

you'll be prompted for username/password : use public_key/private_key from your magento marketplace account

Your Answer

 
discard

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.